View Full Version : Deinterlacing in x264
sjdean
3rd November 2011, 13:57
So question.... In the PAL format, I thought FPS was 50, right?
Yet Im pretty sure when I check out the source format in Handbrake for example, it says 25FPS and I get the option to keep the same Frame Rate as the Source.
My understanding of Deinterlacing, is that you throw away half the frame. So during deinterlacing, am I throwing away half the frame and down converting to 25FPS? Is there a more intelligent way of combining the two fields and restoring 50FPS, or am I talking utter rubbish.
I think the concern comes from the fact I've heard that deinterlacing gives a naturally lower quality as it throws away half the frame. Yet things like BluRay players do a really nice job of upscaling and deinterlacing OK don't they. How do I get those settings into x264? ;-)
Thanks
Simon
titlis
3rd November 2011, 14:14
Deinterlacing is not a problem dealt with x264, but with Avisynth Script.
And actually, PAL format's FPS is 25, Frame rate is half of Field rate.
Thus, bob deinterlacing is sometimes called 'frame doubling'.
And Yadif (http://avisynth.org/mediawiki/Yadif) would work best at any source in Speed,Quality wise....
sneaker_ger
3rd November 2011, 14:20
My understanding of Deinterlacing, is that you throw away half the frame. So during deinterlacing, am I throwing away half the frame and down converting to 25FPS?
That is indeed the way HandBrake currently does it.
Is there a more intelligent way of combining the two fields and restoring 50FPS, or am I talking utter rubbish.
It is usually called "Bobbing" or "Double Rate Deinterlacing", but HandBrake does not support it (yet (https://reviews.handbrake.fr/r/207/)).
I think the concern comes from the fact I've heard that deinterlacing gives a naturally lower quality as it throws away half the frame. Yet things like BluRay players do a really nice job of upscaling and deinterlacing OK don't they. How do I get those settings into x264? ;-)
Basically it comes down to three choices:
1.) Deinterlace while throwing away half the temporal resolution, resulting in 25 fps progressive (what HandBrake currently does)
2.) Deinterlace while keeping the full temporal resolution, resulting in 50 fps progressive ("Bobbing"/"Double Rate Deinterlacing")
3.) Keeping it interlaced, with 50 fields per seconds. Then the player/display has to deinterlace. Note that interlaced encoding is less efficient compared to progressive and players/displays can have very bad deinterlacers, so deinterlacing before encoding is a good idea when using x264
nm
3rd November 2011, 17:26
3.) Keeping it interlaced, with 50 fields per seconds. Then the player/display has to deinterlace. Note that interlaced encoding is less efficient compared to progressive and players/displays can have very bad deinterlacers, so deinterlacing before encoding is a good idea when using x264
x264 now has adaptive MBAFF, so interlaced encoding is more efficient than it used to be. If you have an interlaced source, encoding it as interlaced instead of bobbing will likely save some space at the same quality. That's if the same deinterlacers are used for playback and encoding.
From playback quality standpoint, your point about poor hardware deinterlacing stands, but on the other hand many people opt to use yadif, which isn't any better. Another factor is hardware support for 50 fps and 60 fps video: Blu-ray only supports 720p at those framerates, so PAL would need to be scaled up -- again wasting bits.
Personally I don't care about Blu-ray or other hw players, so I bob my PAL DVB captures with QTGMC and even crop the video to mod 2 frame sizes.
sjdean
3rd November 2011, 18:35
I love you guys. You guys are the best.
Referring to Sneakers post, which option is the best method to use? Let me guess, depends on the source?
Certainly Ive seen artefacts through the first method especially on animated source (like South Park) - the way I presume Handbrake does it (perhaps I need a better deinterlacer). The third option doesn't sound that great especially if portability is the main concern and support for interlaced x264 is hit and miss.
The second option sounds better... but...
a) Is it worth it?
b) Are there better deinterlaces for 25fps videos (option one) than using handbrake?
c) How would you best do option two with a vob source (Mpeg2, AC3)?
I presume ditching Handbrake and switching to AviSynth for pre-processing would be a good idea, then feed this into handbrake?
Thanks
simon
deets
3rd November 2011, 18:50
do you have an nvidia graphics card?
sjdean
3rd November 2011, 19:44
Yup. An NVidia 9800GT
Asmodian
4th November 2011, 23:10
Using DGDecodeNV to load your source in avisynth allows one to use Nvidia's hardware deinterlacing which is pretty good, it offers both bob to 50fps or keep it at 25fps. It gives blended frames rather than throwing out one field for 25fps.
You could also encode as interlaced and as long as you use EVR you can use the hardware deinterlacing at playback (AMD/ATI has hardware deinterlacing for playback as well, just no way to access in an encoding chain). Obviously this isn't a good option for portability to other progressive devices with bad or no deinterlacing.
Guest
4th November 2011, 23:12
It gives blended frames That is not correct.
Asmodian
4th November 2011, 23:41
Really? I swear I get blended frames when setting deinterlacing to 1 on a real interlaced sorce (every field captured at a different time) using my GT545. :confused:
I'll recheck when I get home. :o
Guest
5th November 2011, 03:35
Make sure your source is not field blended.
Asmodian
5th November 2011, 04:17
You are right, of course, it was just motion blur from a bad camcorder. Teach me to retest deinterlacing methods on one source and not think about it (why have use_top_field if it is blending?).
Blended fields look worse than what I am seeing too. :o
mike20021969
5th November 2011, 14:24
My understanding of Deinterlacing, is that you throw away half the frame. So during deinterlacing, am I throwing away half the frame and down converting to 25FPS?
That is indeed the way HandBrake currently does it.
Not quite. From a developer...
Deinterlacing doesn't exactly throw away half the lines. But it does filter the lines to eliminate the combing artifacts, and that filtering results in some loss of quality.
Source: https://forum.handbrake.fr/viewtopic.php?f=11&t=22515
sneaker_ger
5th November 2011, 14:46
My bad, though the "fast" filter is not very far from it. Yadif is another story, of course.
sjdean
5th November 2011, 17:06
Meh. Less than impressed with this digital malarky.... trying to encode an episode of House, get way too much banding in the background, and Im talking about greens and blues and not just darker scenes.
Encode a noisy video (NewsRadio) finds Im using almost as much file space as the original MPEG2.
Interlaced videos like my Buffy the Vampire Slayer are very stuttery.
Am I expecting too much from Handrake/x264/MPEG4? Maybe I should just cut my losses and use MPEG4 as a way of creating a portable movie collection for my Android Tablet/Phone and put the VOBs on the Media Centre?
ChiDragon
5th November 2011, 23:01
All of the shows you just mentioned were shot on film (or at film rate). There shouldn't be any need to deinterlace House, in particular.
sjdean
5th November 2011, 23:16
BUffy (at least Season 2) is quite interlaced, though not heavily. Encoding shows a lot of combs and a media info checker shows it is interlaced. Interestingly though, the deinterlaced video shows juddery in Quicktime player and fine if I rename the m4v to mkv and play it back in DivX Player. You're right about House, but Im just a bit annoyed with the colour banding Im seeing.
If I could get the colour banding, the interlacing, and the file size under control, I'd be a happier bunny.
I'll get some sample video and get someone to take their best shot at it! :-)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.