VideoHelp Forum

Our website is made possible by displaying online advertisements to our visitors. Consider supporting us by disable your adblocker or Try ConvertXtoDVD and convert all your movies to DVD. Free trial ! :)
+ Reply to Thread
Results 1 to 8 of 8
  1. Hi, I am trying to deinterlace a file using ffmpeg.

    I tried the -f:v yadif and -f:v bwdif options, and variants like -vf yadif=1, but the resulting file is progressive but still looks interlaced.
    While the handbrake with the decomb video option looks perfect.

    I am not sure if I am even using the -f:v options correctly as I see no indication on the console output of a filter being used.
    I also don't really know the difference between -vf and -f:v, maybe old and new formats, as I see examples use them interchangeably.

    Here is my commandline:
    ffmpeg.exe -i "D:\Temp\top.gear.s26e04.1080p.hdtv.h264-mtb.mkv" -map 0 -f:v yadif -c:v libx264 -crf 20 -preset medium -c:a copy -c copy -max_muxing_queue_size 1024 -f matroska "D:\Temp\top.gear.s26e04.1080p.hdtv.h264-mtb.tmp.yadif.mkv"

    1) How do I know from looking at the commandline output that a filter is active?
    2) Am I using the -f:v option correctly?
    3) Any other ideas?

    Quote Quote  
  2. Member
    Join Date
    Mar 2008
    United States
    Search Comp PM
    Specify it like this:
    -vf yadif
    or for bob
    -vf yadif=1
    to verify the result, look at it frame by frame in virtualdub2.
    If you're still having issues upload a section of the source showing steady movement
    Last edited by davexnet; 16th Mar 2019 at 14:34.
    Quote Quote  
  3. I tried a few options, looks like the -v:f option does not work while -fv works, if -v:f is supposed to work, am I using it wrong?
    I tried yadaf, yadif=1, and bwdif, none produce great results.

    Compared to Handbrake decomb, the ffmpeg results are very juddery.

    I stepped frame by frame in virtualdub2, and it shows motion artifacts in the ffmpeg output, but not the handbrake output.

    Here is a OneDrive link with sample files, I used mkvmerge to create a 3 minute snippet, skip to the 1 minute mark in the snippet to see lots of interlacing artifacts.!AqeqhT0NczrNisN1mEjGU11WTemcAQ

    I'd like to get ffmpeg to give similar results, ideally with commandline options that work on any material, interlaced or not?
    Quote Quote  
  4. Do I get this right, you didn't upload the 1min source you filtered and want folks to suggest a command line that will help based on filtered content?

    ideally with commandline options that work on any material, interlaced or not?
    not possible

    Also you won't get ffmpeg to work like handbrakes decomb filter since it doesn't have that filer.
    If you want decomb from Handbrake, why not use HandbrakeCLI ?
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. I don't follow, upload what 1 min source, I gave a link to a 3 min snippet of the full file, would you like me to add the whole file?

    My automated workflow is based on ffmpeg, not handbrake, so I'd like to make handbrake work with this type of input content.
    I could not get ffmpeg to work, so I tried handbrake, and handbrake produced good results, thus it should be somehow possible.

    I'm not asking for ffmpeg to have the same filters as hanbrake, just your suggestions on how to produce similar quality output using ffmpeg.

    As for work with all files, it does make life more complicated if I have to use different commanline arguments for different content, but it is possible, please just help me with the recipe.
    Quote Quote  
  6. I don't follow, upload what 1 min source, I gave a link to a 3 min snippet of the full file, would you like me to add the whole file?
    Sorry, overlooked the snipped.

    Your problem is that the snipped is mixed content. (progressive and interlaced content)
    Personally I would use QTGMC with Vapoursynth (using Hybrid) and be done with it or I keep the interlaced encoding when encoding to H.264 since MBAFF (Macroblock-Adaptive Frame/Field Coding) is quite effective and kind of ideal for mixed content.

    You won't get results like decomb (from Handbrake) or QTGMC (Avisynth/Vapoursynth) since those two both so additional filtering (denoising, etc.).

    Instead of ffmpeg I would prefer NVEncC (assuming a decent NVIDIA graphic card is available) with something like:
    NVEnc --avhw native  -i "C:\Users\Selur\Desktop\top.gear.s26e04.1080p.hdtv.h264-mtb.snippet.mkv" --fps 29.97 --codec h264 --profile high --level auto --sar 1:1 --lookahead 16 --cqp 20 --gop-len 0 --bframes 0 --ref 7 --mv-precision Q-pel --cabac --deblock --preset quality --colorprim bt709 --transfer bt709 --colormatrix bt709 --vpp-deinterlace adaptive --vpp-resize lanczos --output-res 1920x1080 --vpp-gauss disabled --output "E:\Temp\top.gear.s26e04.1080p.hdtv.h264-mtb.snippet_22_22_48_7710_01.264"
    (in this example I ignore the audio, but NVEncC can also handle the audio)

    If I was on Linux and a NVIDIA card was available I would use YADIF_CUDA (see:

    QSVEncC and the qsv support in ffmpeg would also be a possibility. (In my experience the hardware deinterlacers from NVEnc and QSVEnc are better than anything ffmpeg currently has.)

    Assuming no gpu hardware acceleration is available and ffmpeg should be use, I would stick with yadif, and may be add some additional filtering.

    Cu Selur

    Ps.: Out of curiosity why not use StaxRip, MeGui or similar tools which all support batch processing? (No clue whether handbrake supports it.)
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. I wrote an app to make sure that my media files can directplay on plex, so I have a variety of rules and processing logic that sets missing language attributes on streams, strips out unwanted streams, reencodes content that can't directplay or causes issues in plex, and I use mkvtoolnix and ffmpeg for processing, and ffprobe and mediainfo for file stream info.

    The code runs on a W2K16 VM, so no hardware capabilitites are available, just vanilla x64 windows.

    This particular file makes plex stutter very badly, so I was looking to add a new rule, how do I detect this type of file, what do I do with it.

    The steps you describe seem much more elaborate compared to my current workflow, but if I can detect a file with interlaced or mixed interlaced content, I could call a new type of processor, maybe handbrake CLI, but vapoursynth and avisynth do seem overkill and much more complicated vs. a commandline app.

    Unless somebody else has a good idea with ffmpeg options, I'l ltry to add handbrake cli to my toolset.
    Quote Quote  
  8. I changed my code to use MediaInfo's interlaced info and then call HB CLI:

    Scan type : MBAFF
    Scan type, store method : Interleaved fields
    Scan order : Top Field First

    handbrakecli.exe --input "D:\Temp\top.gear.s26e04.1080p.hdtv.h264-mtb.snippet.mkv" --output "D:\Temp\top.gear.s26e04.1080p.hdtv.h264-mtb.hbcli.mkv" --format av_mkv --encoder x264 --encoder-preset medium --quality 21.0 --comb-detect --decomb --subtitle 1,2,3,4 --audio 1,2,3,4 --aencoder copy --audio-fallback eac3
    Quote Quote  

Similar Threads