View Full Version : How to do good deinterlacing with mencoder ?
Selur
2nd February 2012, 10:57
Just wondering is there a side somewhere that has some recommendations or can someone here recommend which and how to use mencoders deinterlacers for what content?
i.e.:
- for normal interlaced material
- for telecine material
- for bobbing
- for progressive-interlaced hybrid material
- for progressive-telecine hybrid material
- for interlaced-telecine hybrid material
for normal interlacing I know of:
- yadif=0
- kerndeint
- yadif=1|3,mcdeint=0|1|2|3
- tfields=1,mcdeint=0|1|2|3
- pp=lb|fd|li|md
for telecine I know of:
- pullup,softskip
- filmdint
- decimate=2:1000:1600:.001 -ofps 24000/1001
- yadif=3:1,mcdeint=0:1:10,framestep=2,filmdint=dint_thres=256
- yadif=3:1,mcdeint=1:1:10,framestep=2,filmdint=dint_thres=256
- yadif=3:1,mcdeint=2:1:10,framestep=2,filmdint=dint_thres=256
as bobber I know of:
- yadif=1
- yadif=3
but I'm unsure what of these choices would be a good recommendation and what to do with hybrid material?
Since I'm definitely no pro when it comes to deinterlacing and deinterlacing&mencoder I was wondering if some of the users here could share their experience and recommend something.
I know avisynth can be used through wine, but I really don't want to use wine and avisynth or other tools. My question is: What are good/recommend ways to handle interlacing with mencoder ?
Cu Selur
Ps.: yes, I know of http://guru.multimedia.cx/deinterlacing-filters/ (from 2006)
nm
2nd February 2012, 17:00
Same-framerate deinterlacing (25i->25p, 30i->30p):
Very fast: -vf pp=fd
same as -vf lavcdeint
jagged edges, but otherwise natural output
better than rest of the simple filters
Fast: -vf yadif=0
smoother edges thanks to edge-directed interpolation
has a smearing or oil-painting effect on textured surfaces
Slow: -vf yadif=1:0,mcdeint=0:0:10,framestep=2
Motion-compensated
Field order needs to be specified manually because mcdeint doesn't switch it automatically. So for bottom-field-first (NTSC sources) it would be: -vf yadif=1:1,mcdeint=0:1:10,framestep=2
In my tests I've found that the fastest mode of mcdeint actually gives best results. Output is comparable to some of the better AviSynth filters, but there's more bobbing shimmer than with TGMC. Shimmering doesn't affect same-rate output though.
Mcdeint fixes the terrible smear artifacts of plain yadif, so it's always a good idea to use it when there's time.
Not multi-threaded. Realtime filtering of SD sources requires a very fast CPU.
Double-framerate deinterlacing, aka bobbing (25i->50p, 30i->60p):
Very fast: -vf tfields
Plain bob, lots of shimmering and loss of vertical resolution in static areas
Medium: -vf yadif=1
Same tradeoffs as in the same-rate case.
Shimmers.
MPlayer's implementation is not multi-threaded, so realtime HD filtering may be difficult
Slow: -vf yadif=1:0,mcdeint=0:0:10
Same tradeoffs as in the same-rate case. Speed is also about the same since mcdeint always bobs, and for same-rate output half of the frames are simply dropped.
Shimmers, but output is otherwise better than yadif's.
I don't have much practical experience of using inverse telecine filters.
Selur
2nd February 2012, 17:43
Thanks nm! Hope a few others can also share some of their findings :)
nm
9th February 2012, 15:12
Here's a comparison of how yadif, mcdeint and QTGMC handle detailed moving textures: parkjoy_deint_comparison.mkv (http://ubuntuone.com/05nMvcmtvLXhzBHq3KLBs3?attachment=true)
Pay attention to foliage, grass and the background. Yadif causes a lot of damage in those areas. Surprisingly the fence is also much better with mcdeint.
Notes
Speed is lowered to 5 fps for easier comparison. Speed up by a factor of ten for realtime playback (mplayer -speed 10).
Yadif looks better at realtime speed, but shimmers a lot. Mcdeint=0 leaves some combing artifacts to small moving objects. Mcdeint=2 seems to be slightly better in those areas, and at the spot where the fence appears at the right edge of the frame. QTGMC is very good overall, although one blurred branch that moves over the foreground at frames 215 to 250 (43 to 50 seconds) evaporates in the process.
File sizes (in kilobytes) of the 360x288 samples, encoded losslessly with x264 --qp 0 --preset fast:
yadif=1: 39156
mcdeint=2: 35404
mcdeint=0: 35108
QTGMC: 31532
interlaced: 19800
Original video: parkjoy_pal_original.mkv (http://ubuntuone.com/0eqWnhAioe2HLS9agNpxWQ?attachment=true)
(some of these SVT sources seem to be very hard to find these days).
cord-factor
11th February 2012, 13:48
QTGMS is the best. Where can we get it?
Selur
11th February 2012, 13:51
QTGMC is a Avisynth (= mainly windows) plugin, it's not available in mencoder, it's just there as some sort of reference. :)
(you could use avisynth through wine, but no clue if it's possible to get avisynth+gtgmc+wine to run stable on linux)
nm
11th February 2012, 18:23
(you could use avisynth through wine, but no clue if it's possible to get avisynth+gtgmc+wine to run stable on linux)
It runs perfectly stable. I use AviSynth in Wine all the time and all common plugins work just as well as on Windows. Take a look at this thread for further information: http://forum.doom9.org/showthread.php?t=161925
Some source filters are difficult because they rely on missing external systems, such as DirectShow or NVCUVID (and GPU drivers). FFMS2 works.
Selur
11th February 2012, 19:26
Good to know. Do you have to use avs2yuv or can you use mencoder instead? (assumed it is compiled with avisynth support)
(I would if I try it probably want to use it through mencoder an then pipe to vpxenc/x264)
nm
12th February 2012, 01:55
Good to know. Do you have to use avs2yuv or can you use mencoder instead? (assumed it is compiled with avisynth support)
You could possibly use a custom Windows build of MEncoder, but I've never tried that.
What would be the advantage of using MEncoder instead of avs2yuv when piping to a separate encoder?
Selur
12th February 2012, 06:49
No, I wanted to use a linux build, iirc it should be possible to compile mencoder with avs support on linux,...
What would be the advantage of using MEncoder instead of avs2yuv when piping to a separate encoder?
mainly to keep to tool count down :)
nm
12th February 2012, 13:57
No, I wanted to use a linux build, iirc it should be possible to compile mencoder with avs support on linux,...
I don't think it's possible without a Linux build of AviSynth (and all the plugins). You need native libraries to link against.
Selur
12th February 2012, 13:58
Thanks. That's sad but good to know. :)
cord-factor
13th February 2012, 16:11
I hope one day QTGMC will be ported to linux as ffmpeg filter.
dorwell
3rd March 2012, 00:09
It runs perfectly stable. I use AviSynth in Wine all the time and all common plugins work just as well as on Windows.
Hi,
I'm trying to use avisynth on linux (dual boot debian / arch) in order to deinterlace *.MTS file but I don't understand how to install FFMS2.
Thanks in advance
dcouzin
14th August 2012, 17:48
There are vast differences in quality among deinterlacers. Better deinterlacers employ some version of optical flow. They fill in the missing lines in a field by reference to information in that field plus fields before and after. Software implementations generally run slowly.
At least as great quality differences should be expected from double framerate deinterlacers as from same framerate deinterlacers since the former may be achieved by two applications of the latter. I explained this recently in another forum (http://www.lafcpug.org/phorum/read.php?1,279484). (Note that we say 50i and 60i, not 25i and 30i, in that other forum.) At the end of that post are links to an interlaced original (from DV-PAL) and its high quality double framerate deinterlace. People might wish to test if their methods achieve similar quality.
Asmodian
15th August 2012, 21:35
@dcouzin
Since you are new here and your link is a somewhat tricky way to get better 50p from 50i I wonder if you have tried QTGMC?
Avisynth based so Windows only of course but I have never found a better quality method.
dcouzin
17th August 2012, 10:26
@Asmodian
Thanks. I see I have a lot to learn.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.