Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Linux, Mac OS X, & Co

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd February 2012, 10:57   #1  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
How to do good deinterlacing with mencoder ?

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)
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 2nd February 2012 at 11:06.
Selur is offline   Reply With Quote
Old 2nd February 2012, 17:00   #2  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
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.

Last edited by nm; 2nd February 2012 at 17:05.
nm is offline   Reply With Quote
Old 2nd February 2012, 17:43   #3  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
Thanks nm! Hope a few others can also share some of their findings
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 9th February 2012, 15:12   #4  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
Here's a comparison of how yadif, mcdeint and QTGMC handle detailed moving textures: parkjoy_deint_comparison.mkv

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:

    Code:
    yadif=1:     39156
    mcdeint=2:   35404
    mcdeint=0:   35108
    QTGMC:       31532
    
    interlaced:  19800

Original video: parkjoy_pal_original.mkv
(some of these SVT sources seem to be very hard to find these days).
nm is offline   Reply With Quote
Old 11th February 2012, 13:48   #5  |  Link
cord-factor
Registered User
 
Join Date: Jan 2008
Location: Kharkov, UA
Posts: 105
QTGMS is the best. Where can we get it?
__________________
Gentoo linux
cord-factor is offline   Reply With Quote
Old 11th February 2012, 13:51   #6  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
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)
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 11th February 2012, 18:23   #7  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
Quote:
Originally Posted by Selur View Post
(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.
nm is offline   Reply With Quote
Old 11th February 2012, 19:26   #8  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
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)
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 11th February 2012 at 19:28.
Selur is offline   Reply With Quote
Old 12th February 2012, 01:55   #9  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
Quote:
Originally Posted by Selur View Post
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?
nm is offline   Reply With Quote
Old 12th February 2012, 06:49   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
No, I wanted to use a linux build, iirc it should be possible to compile mencoder with avs support on linux,...

Quote:
What would be the advantage of using MEncoder instead of avs2yuv when piping to a separate encoder?
mainly to keep to tool count down
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 12th February 2012, 13:57   #11  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,643
Quote:
Originally Posted by Selur View Post
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.
nm is offline   Reply With Quote
Old 12th February 2012, 13:58   #12  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,182
Thanks. That's sad but good to know.
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 13th February 2012, 16:11   #13  |  Link
cord-factor
Registered User
 
Join Date: Jan 2008
Location: Kharkov, UA
Posts: 105
I hope one day QTGMC will be ported to linux as ffmpeg filter.
__________________
Gentoo linux
cord-factor is offline   Reply With Quote
Old 3rd March 2012, 00:09   #14  |  Link
dorwell
Registered User
 
Join Date: Feb 2012
Posts: 1
Quote:
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
dorwell is offline   Reply With Quote
Old 14th August 2012, 17:48   #15  |  Link
dcouzin
Registered User
 
Join Date: Aug 2012
Location: Berlin, Germany
Posts: 2
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. (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.
dcouzin is offline   Reply With Quote
Old 15th August 2012, 21:35   #16  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,047
@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.
Asmodian is offline   Reply With Quote
Old 17th August 2012, 10:26   #17  |  Link
dcouzin
Registered User
 
Join Date: Aug 2012
Location: Berlin, Germany
Posts: 2
@Asmodian
Thanks. I see I have a lot to learn.
dcouzin is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:33.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.