• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Off Topic General Discussion Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...)

    Pages (12): « Previous 1 … 6 7 8 9 10 … 12 Next »
     

     
    • 0 Vote(s) - 0 Average

    Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...)

    Bring your resources, guides, questions, suggestions, cluelessness. All is welcome.
    bitmap
    Offline

    Community Moderator

    Posts: 781
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #71
    2023-10-31, 10:23 PM
    You got it, specify the device since ffmpeg can't infer that anymore. By default I think it'll use the first card in line, which is your iGPU. If you don't have multiple drivers installed, you shouldn't need all of what's in there, but being specific never hurts.
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    bitmap
    Offline

    Community Moderator

    Posts: 781
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #72
    2023-11-01, 07:39 AM
    Okay, so I figured out there's a QSV tonemapping filter, which is used by Jellyfin as well. Use the first line of the code below to get the full output of the vpp_qsv filter, which includes quite a few other filter options. I have not tested to see if VPP tonemapping is more accurate, has costs to brightness or quality, etc... I do now know that the filter you're using above simply CLIPS the out-of-range colors, which is not the best application of tonemapping. You might want to consider hable or reinhard -- you can see here (https://ayosec.github.io/ffmpeg-filters-...nemap.html) brief information about the options for non-QSV tonemapping. You could also look at the defaults in Jellyfin to get an idea of what to use if you don't want to use the QSV version -- disable HWA and take a look at the recommended defaults for tonemapping.

    There's also an OpenCL and straight VAAPI tonemapping option, so either of those might work for you as well. The QSV option is extremely simple...I think.

    Code:
    bitmap@server:testing$ ffmpeg -h filter=vpp_qsv
    Filter vpp_qsv
      Quick Sync Video "VPP"
        Inputs:
           #0: default (video)
        Outputs:
           #0: default (video)
    vpp_qsv AVOptions:
       procamp           <int>        ..FV....... Enable ProcAmp (from 0 to 1) (default 0)
       brightness        <float>      ..FV....... ProcAmp brightness (from -100 to 100) (default 0)
       w                 <string>     ..FV....... Output video width(0=input video width, -1=keep input video aspect) (default "cw")                                                                                                                            
       h                 <string>     ..FV....... Output video height(0=input video height, -1=keep input video aspect) (default "w*ch/cw")                                                                                                                      
       format            <string>     ..FV....... Output pixel format (default "same")                                                                                                                                                                                                                                                                        
       scale_mode        <int>        ..FV....... scaling & format conversion mode (mode compute(3), vd(4) and ve(5) are only available on some platforms) (from 0 to 5) (default auto)                                                                          
         auto            0            ..FV....... auto mode                                                                                                                                                                                                      
         low_power       1            ..FV....... low power mode                                                                                                                                                                                                
         hq              2            ..FV....... high quality mode                                                                                                                                                                                              
         compute         3            ..FV....... compute                                                                                                                                                                                                        
         vd              4            ..FV....... vd                                                                                                                                                                                                            
         ve              5            ..FV....... ve                                                                                                                                                                                                                                                                                                                                                                  
       out_range         <int>        ..FV....... Output color range (from 0 to 2) (default 0)                                                                                                                                                                  
         full            2            ..FV....... Full range                                                                                                                                                                                                    
         limited         1            ..FV....... Limited range
         jpeg            2            ..FV....... Full range
         mpeg            1            ..FV....... Limited range
         tv              1            ..FV....... Limited range
         pc              2            ..FV....... Full range
       out_color_matrix  <string>     ..FV....... Output color matrix coefficient set
       out_color_primaries <string>     ..FV....... Output color primaries
       out_color_transfer <string>     ..FV....... Output color transfer characteristics
       tonemap           <int>        ..FV....... Perform tonemapping (0=disable tonemapping, 1=perform tonemapping if the input has HDR metadata) (from 0 to 1) (default 0)

    I left in the options that you might want to use like ProcAmp if you want to enhance the brightness (can also change saturation, hue), w/h in case you want to scale, format and scale_mode for additional flexibility, out_range in case you want to set this explicitly (should be Limited in nearly all cases), and out_color_X options so you can set these according to your tonemapping.
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #73
    2023-11-01, 01:19 PM (This post was last modified: 2023-11-01, 01:29 PM by TheDreadPirate. Edited 1 time in total.)
    I did notice some minor to moderate artifacting that I didn't notice initially.  Mostly in darker and brighter parts of a scene.  I'm wondering if this is related to using the clip option.  I wish I had some shorter content to test on.  I'll have to find some free HDR clips and experiment.

    Edit: I found the tonemapping logic for Jellyfin.

    https://github.com/jellyfin/jellyfin-ffm...p_opencl.c
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    bitmap
    Offline

    Community Moderator

    Posts: 781
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #74
    2023-11-01, 04:04 PM
    For a shorter clip, use time bound options for your current media. You can just encode a snippet with the seek option.
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    Deleted User

    Unregistered
     
    #75
    2023-11-01, 04:24 PM
    (2023-11-01, 04:04 PM)bitmap Wrote: For a shorter clip, use time bound options for your current media. You can just encode a snippet with the seek option.

    yes, precisely what i do for tests

    5 minute sample, starting at 5 minutes -ss 00:05:00 -t 00:05:00

    you may also find something further in the video with higher motion rate which will affect an encode
    - but know that -ss will in fact scan the frames up to that point to start time so too far into the video will take almost as long as a full encode anyway
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #76
    2023-11-01, 04:31 PM
    *groan* Not sure why I didn't think of that. I use -ss and -to when I am splitting episodes when they come off the disc as 1 file.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Deleted User

    Unregistered
     
    #77
    2023-11-01, 04:36 PM
    (2023-11-01, 04:31 PM)TheDreadPirate Wrote: *groan*  Not sure why I didn't think of that.  I use -ss and -to when I am splitting episodes when they come off the disc as 1 file.

    usually happens when you stare at something too long, just need a 3rd party to refocus the issue at hand 👍
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #78
    2023-11-12, 04:13 AM (This post was last modified: 2023-11-12, 04:14 AM by TheDreadPirate.)
    I figured out some quirks with QSV with Arc. When you are using any video filters, you are required to specify a deinterlace parameter. Even if it is disabled (deinterlace=0).

    Code:
    -vf vpp_qsv=deinterlace=0:cw=1920:cx=0:w=1920:h=1080

    I figured out the syntax for cropping, but how it works is different so still testing that.

    I am super annoyed that I couldn't simply change "hevc_qsv" to "av1_qsv".

    My backlog can be serviced with what I have now. But going to have to figure out tone mapping AGAIN. I think my scaling parameters will work as is, based on the documentation I read.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #79
    2023-11-12, 10:21 PM
    @bitmap How does HDR and 10 bit color work with AV1?  I can't find documentation about AV1 profiles, like main vs main10 in HEVC.  One of my HDR10 test encodes appears to have automatically used 10 bit color without my having to specify that during the encode.  Does AV1 automatically do that?

       
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    bitmap
    Offline

    Community Moderator

    Posts: 781
    Threads: 9
    Joined: 2023 Jul
    Reputation: 24
    #80
    2023-11-13, 12:26 AM (This post was last modified: 2023-11-13, 12:28 AM by bitmap. Edited 1 time in total.)
    Depends on the encoder. If we're talking av1_qsv, I've found that currently only 8->8 and 10->10 works properly. Everything else gives me an error. So that's dependent upon source and is automatic. By default, if you're doing a one-for-encode without mapping anything, any necessary metadata should come over with the encode automatically and the doesn't appear to be a flag like with SVT-AV1.

    So in my experience, it's almost automatic. When mapping streams, you need to ensure that you map the metadata correctly in most cases, which I'm still struggling with a bit. I haven't had a single AV1 encode with HDR fail, though without the metadata I have had encodes fail to play properly.

    On profiles/levels: they don't work the same as HEVC. Profile should be main for nearly everything, as I think the next up is professional? Run ffmpeg -h encoder=av1_qsv for more details about what options are available. Note that a lot of things are broken at the moment.
    Jellyfin 10.10.7 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage

    [Image: AIL4fc84QG6uSnTDEZiCCtosg7uAA8x9j1myFaFs...qL0Q=w2400]
    Pages (12): « Previous 1 … 6 7 8 9 10 … 12 Next »
     

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode