VideoHelp Forum
+ Reply to Thread
Results 1 to 4 of 4
Thread
  1. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Hello, for ffmpeg NVENC x264 encodes (Nvidia GPU hardware accelerated) what is the correct "best" ffmpeg commandline to convert a PAL 576i interlaced TV capture file to progressive mp4 ? A lot of web pages mentioning ffmpeg say to use "-c:v nvenc_h264" however ffmpeg spits and says use "-c:v h264_nvenc" instead.

    Code:
    ffmpeg.exe" -i ".\test.ts" -map_metadata -1 -filter:v yadif=0:0:0,setdar=dar=16/9 -r 25 -c:v h264_nvenc -preset hq -profile:v high -level 4.1 -pixel_format yuv420p -movflags +faststart -c:a libmp3lame -ab 256k -y ".\test.ts.nvenc.mp4"
    That encodes at about 565 fps, which i'm happy with, and when watching as it encodes the "q" seems to fluctuate up and down as if it's deciding what the right quality/bitrate value to use is as it goes along.

    This one below uses what seems to be a useable fixed "-q" but sometimes the encode commandline above displays a "-q" lower than the fixed 20 value below and more often higher.

    Code:
    ffmpeg.exe" -i ".\test.ts" -map_metadata -1 -filter:v yadif=0:0:0,setdar=dar=16/9 -r 25 -c:v h264_nvenc -rc:v constqp -global_quality 20 -preset hq -profile:v high -level 4.1 -pixel_format yuv420p -movflags +faststart -c:a libmp3lame -ab 256k -y ".\test.ts.nvenc.mp4"
    In both, it can appear to be a tad soft from time to time and also a bit shimmery from time to time, so adding unsharp like -filter:v yadif=0:0:0,setdar=dar=16/9,unsharp seems to sharpen it a bit even it it still leaves it a tad shimmery. Adding unsharp makes it encode at about 207 fps.

    I suppose there's no way to make nvenc accept interlaced input and encode interlaced output ? (interlaced retains better "motion fluidity" for fast moving sports action where the incoming native file is interlaced and the only options are 25fps progressive or 25fps interlaced).

    Also,
    • I suppose setdar=dar=16/9 is still the right thing for PAL 1080i input and 720p input (no yadif on 720p, yes) ?
    • Has ffmpeg's aac encoding quality progressed enough that should I be using something like "-c:a aac" instead of "-c:a libmp3lame" and if so what equivalent ffmpeg commandline settings should I use ? (mp3 was the next best for cross compatibility with both an old WDTV media player and a Chromecast).
    Advice welcomed.
    Thanks

    PS I thought this thread looked interesting, suggesting using ffmpeg with nvidia-GPU-hardware for simultaneous CUDA resizing and NVENC encoding.
    https://www.phoronix.com/forums/forum/linux-graphics-x-org-drivers/nvidia-linux/46654-...h-ffmpeg/page5
    Quote Quote  
  2. Originally Posted by hydra3333 View Post
    In both, it can appear to be a tad soft from time to time and also a bit shimmery from time to time, so adding unsharp like -filter:v yadif=0:0:0,setdar=dar=16/9,unsharp seems to sharpen it a bit even it it still leaves it a tad shimmery.
    Please elaborate on this - what means "shimmery"? Adding unsharp usually worsening quality (artificially adding high frequency force quantizer to be higher - instead unshapr you may consider to add small amount of noise to luma plane - it should stabilise quantizer and improve perceived sharpnes).
    All described problems looking like poor bitrate control in encoder - i would consider 2 pass if possible to avoid quantizer pumping.
    Not sure about your quality expectations but i assume that libx264 may be substantially better and perhaps 2 - 4 times slower - i use nvenc for real time encoding as encoded stream is feed trough multiplexer directly to QAM modulator...

    AAC is quite OK in ffmpeg currently - go for sane bitrates (56 - 64kbps per channel) - MP3 is more compatible with old HW but any HD capable decoder should accept AAC (better than MP3 - multichannel, higher sampling rates etc).

    Interlace encoding - honestly have no clue how to use nvenc in interlace mode - maybe in similar way as in H.265 but HW decoders may be not able to understand this...
    Quote Quote  
  3. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Originally Posted by pandy View Post
    Please elaborate on this - what means "shimmery"?
    Well, from time to time small "stable" areas look as if they flicker at you moreso if it has horizontal lines although it's hard to tell.

    Originally Posted by pandy View Post
    Adding unsharp usually worsening quality (artificially adding high frequency force quantizer to be higher - instead unshapr you may consider to add small amount of noise to luma plane - it should stabilise quantizer and improve perceived sharpnes).
    OK. How in ffmpeg ?

    Originally Posted by pandy View Post
    i use nvenc for real time encoding as encoded stream is feed trough multiplexer directly to QAM modulator...
    Yes I intend to use for small TV captures for timeshifted viewing where great quality isn't the main objective ... "good enough" mp4 for casting is.

    Thanks.
    Last edited by hydra3333; 7th Sep 2016 at 09:11.
    Quote Quote  
  4. Originally Posted by hydra3333 View Post
    Originally Posted by pandy View Post
    Please elaborate on this - what means "shimmery"?
    Well, from time to time small "stable" areas look as if they flicker at you moreso if it has horizontal lines although it's hard to tell.
    Based on description it looks like typical quantizer pumping (codec is overloaded and significant change in quantizer value is required (when compared to previous). You may try to tweak GOP size and quantizer settings, increasing VBV buffer may help too.

    Originally Posted by hydra3333 View Post
    OK. How in ffmpeg ?
    For example:

    Code:
    -vf noise=c0s=10:c1s=0:c2s=0:c0f=a+t
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!