View Full Version : Dummie question about Interlaced encoding in MPEG-4
aLu
2nd January 2007, 19:14
I understand the basic principle of interlacing, that it alternately displays the even and odd lines on TV (= "pixel" lines digitally??). Encoders like XVID offer interlaced encoding in MPEG-4. But does it make sense to take my interlaced source, SCALE it down (& change the aspect ratio), and use XVID with interlacing? What are the do's and don'ts?
I've found many guides about interlacing, but not one that covers this question. Call me stupid if it's self-evident http://forum.doom9.org/images/smilies/biggrin.gif
:D
TnX for your comments.
SeeMoreDigital
2nd January 2007, 19:55
If you are intending to generate interlaced MPEG-4 encodes DON'T re-size them.... Keep them at the same resolution as your interlaced source.
You can however, crop away any visible black mattes (ie: above and below the image) in 16 pixel increments.
By-the-way, interlaced MPEG-4 encodes look great when played via a stand-alone player....
Cheers
Manao
2nd January 2007, 20:04
You can scale down horizontally and encode as interlaced. If you scale down vertically, you must deinterlace the video before resizing it. Then, of course, you encode it as progressive.
Unless you perceive a degradation of the motion fluidity after the deinterlacing, or unless you're watching the video on an interlaced display ( TV ), I strongly advise you to deinterlace the video.
SeeMoreDigital
2nd January 2007, 20:22
Unless you perceive a degradation of the motion fluidity after the deinterlacing, or unless you're watching the video on an interlaced display ( TV ), I strongly advise you to deinterlace the video.I can assure you there's really no requirement to generate de-interlaced MPEG-4 encodes for viewing on a progressive capable display.... I have a 42" progressive capable 42" display that's hooked up via component to my MPEG-4 stand-alone hardware player... no issues here :D
Manao
2nd January 2007, 20:30
Deinterlacing means at least a 30% bitrate saving. That's non neglictable. Furthermore, deinterlacing before encoding means you can use slow deinterlacer, which may be of a better quality than the bobber that comes integrated into your progressive display.
Moreover, sometime people just can't control the postprocessing that will be apply to their video. If you can't deinterlace on playback but you're stuck on a progressive display, it would have been definitely better to deinterlace before encoding.
SeeMoreDigital
2nd January 2007, 20:39
Moreover, sometime people just can't control the postprocessing that will be apply to their video. If you can't deinterlace on playback but you're stuck on a progressive display, it would have been definitely better to deinterlace before encoding.In a software player I (more-or-less) agree... but this does not happen in hardware player!
aLu
2nd January 2007, 20:52
Is it OK to resize (vertically) from anamorphic to 4:3? How should I set the "Pixel aspect ratio" in this case (4:3 or Square) for correct interlacing?
For anamorphic it would have to be 16:9, I guess.
SeeMoreDigital
2nd January 2007, 20:54
Is it OK to resize (vertically) from anamorphic to 4:3? How should I set the "Pixel aspect ratio" in this case (4:3 or Square) for correct interlacing?NO... not unless you de-interlace!
By-the-way.... Are your sources PAL or NTSC?
Cheers
aLu
2nd January 2007, 20:58
The source is PAL Anamorphic (Standard DVD). It has some interlaced TV snippets. I would like to have a 4:3 aspect ratio - preferrably without scaling up to 1024x576.
I looked at SeeMoreDigital's Page (What is... an Anamorphic image?), but I'm not much wiser concerning interlacing and PAR in XVID. According to the XVID/Virtualdub guide (http://www.doom9.org/xvid-vdub-11.htm), the PAR is only relevant for playback - or is it not?
So how does XVID interlacing work? How many (vertical) pixels make up one "field", and can this value be changed?
henryho_hk
3rd January 2007, 02:18
I suppose your source is 720x576 full-screen (not letter-boxed) interlaced. Is it standard screen (4:3) or wide screen (16:9)? I am a bit confused because "anamorphic" usually means 16:9 or 2.35:1 but you are always talking about 4:3.
Jay Bee
3rd January 2007, 05:56
Deinterlacing means at least a 30% bitrate saving.
Or 50% temporal resolution loss, depending on source type and deinterlacing method.
*.mp4 guy
3rd January 2007, 14:53
Mvbob->resize to 1/2 total pixel area(ie 720*480 to 480*352)->30% or more bitrate savings and full temporal resolution, looks a lot better then interlaced.
aLu
3rd January 2007, 15:01
That's not the point. :o I was wondering if proper XVID interlacing could compete with MPEG-2 if configured properly (on the PC monitor). I couldn't find any tutorial. I've tested a little - without scaling the source - and it DOES look crappy in scene changes and high motion - as you can read everywhere, but I wonder if those guys knew what they were doing. A little education is needed.
If it worked, you'd NEVER HAVE to deinterlace AGAIN unless you really wanted a progressive video. Wow!
SeeMoreDigital
3rd January 2007, 15:11
Mvbob->resize to 1/2 total pixel area(ie 720*480 to 480*352)->30% or more bitrate savings and full temporal resolution, looks a lot better then interlaced.I beg to differ..... It won't look good on a 32" or above screen!
SeeMoreDigital
3rd January 2007, 15:19
If it worked, you'd NEVER HAVE to deinterlace AGAIN unless you really wanted a progressive video. Wow!Sadly, playing "pure interlaced" MPEG-4 sources using software decoders (and viewing via PC monitors) is not very successful.... VLC player outputs fairly good results but you'll set its "de-interlace" option to "Bob".
Cheers
Manao
3rd January 2007, 15:33
SMD : nothing sub HD will look good on such a screen...
*.mp4 guy : on an interlaced display, i'd keep the video interlaced. Also, 352x480i with the proper aspect ratio is a viable solution to resize the video.
*.mp4 guy
3rd January 2007, 15:36
My example was assuming that you used the same bitrate for the interlaced and deinterlaced video, and that it was high motion video that would actually benefit from the extra temporal resolution. If you are going to give the interlaced video 30% extra bitrate you might aswell not downscale the deinterlaced full framerate video and just use that bitrate, becuase it will look a lot better then the interlaced video at the same bitrate.
[edit] If this is for viewing on an interlaced display Manao's suggestion is the best.
Jay Bee
3rd January 2007, 19:58
Mvbob->resize to 1/2 total pixel area(ie 720*480 to 480*352)->30% or more bitrate savings and full temporal resolution, looks a lot better then interlaced.
Will test.
...and that it was high motion video that would actually benefit from the extra temporal resolution
Deinterlacing to half the field rate always looks stuttery, no matter how fast or slow the motion.
Jay Bee
3rd January 2007, 20:01
.dp..
henryho_hk
4th January 2007, 01:33
Is it OK to resize (vertically) from anamorphic to 4:3? How should I set the "Pixel aspect ratio" in this case (4:3 or Square) for correct interlacing?
"Pixel aspect ratio" (PAR) is the shape of the pixel to be displayed. Hence, it is the player's job to display the correct picture with respect to the PAR specified within the stream. Computer monitor is 1:1 while TV are 4:3 and 16:9 (add PAL & NTSC making 4 variations). Changing PAR is reversible. You can freely change the PAR of MPEG4 and MPEG2 streams by setting corresponding fields. On the other hand, resizing is permanent and irreversible. PAR, being a the pixel-level property, is also independent of interlacing.
When resizing, however, you must also take special handling for interlaced materials. Most resizers are designed for progressive materials and they will seriously screw up interlaced materials. We should instead take more complicated steps like Deinterlace->Resize->Interlace. You can also try integrated functions like InterlacedResize() in SimpleResize.dll and see if it's sufficient for your purpose.
Jay Bee
6th January 2007, 12:54
Mvbob->resize to 1/2 total pixel area(ie 720*480 to 480*352)->30% or more bitrate savings and full temporal resolution, looks a lot better then interlaced.
OK, I spent some time playing around with mvbob and the resizing you suggested (and many other things). In summary, what I found was:
1) mvbob is a very nice deinterlacer that even beats the Purevideo MPEG-2 deinterlacer, although not in every aspect. For example mvbob shows more horizontal artefacts than Purevideo but is very good with jaggy lines. And Purevideo is at least 200x faster...
2) Interlaced AVC files (deinterlaced using CoreAVC/DirectShow) don't deinterlace quite as nicely as MPEG-2 files but all in all AVC MBAFF files look better than interlaced MPEG-2 files at double the bitrate (at least with the MPEG-2 encoders I tried).
3) 512 x 384 p50 does indeed look very good when compared to 720 x 576i at the same bitrate. It's slightly blurry but the good deinterlacing makes up for that.
All in all I would say that both variants (interlaced and progressive) are less than perfect. Interlaced because PC-based realtime MPEG-4 deinterlacing is still quite poorly supported and progressive because mvbob is way too slow to be of any practical use. An MPEG-4 decoder with the quality of the Purevideo MPEG-2 decoder is what we really need IMO or a deinterlacer that compares to mvbob but is much faster. Or, as SMD says, let some real hardware do the work but I can't comment on that as I don't have access to any deinterlacers other than my PC.
Here's some close-up pics if anyone's interested.
mvbob vs Purevideo on 1080i source:
http://img214.imageshack.us/img214/7311/mvbobwc6.th.png (http://img214.imageshack.us/my.php?image=mvbobwc6.png)
http://img102.imageshack.us/img102/6610/purevideocl7.th.png (http://img102.imageshack.us/my.php?image=purevideocl7.png)
AVC 1080 MBAFF vs MPEG2 1080i at double the bitrate:
http://img153.imageshack.us/img153/7697/avcpc9.th.png (http://img153.imageshack.us/my.php?image=avcpc9.png)
http://img329.imageshack.us/img329/3027/mpeg2lo3.th.png (http://img329.imageshack.us/my.php?image=mpeg2lo3.png)
720 x 576i vs 512 x 384 p50 at the same bitrate:
http://img134.imageshack.us/img134/9163/576izk2.th.png (http://img134.imageshack.us/my.php?image=576izk2.png)
http://img134.imageshack.us/img134/7603/384phh6.th.png (http://img134.imageshack.us/my.php?image=384phh6.png)
SeeMoreDigital
6th January 2007, 15:49
With regard to generating encodes from pure interlaced sources, some of you guys might be interested in reading this AVS forum thread (http://archive2.avsforum.com/avs-vb/showthread.php?s=&threadid=515917). Which dates back to March 2005.
Cheers
Jay Bee
6th January 2007, 23:55
In case anyone did have a look at my screenshots above and wondered why I said the horribly blocky MBAFF file looks better than the MPEG-2 it's because I swapped the images. Fixed now.
SMD: since you are happy with watching interlaced MPEG-4 files on your progressive screen I wonder which piece of hardware is doing the deinterlacing? Is it the player or the TV set itself? Is deinterlacing quality of true interlaced content something that gets any attention in reviews of HDTV's for instance? For that matter, are there any websites out there that offer these kind of in-depth reviews?
SeeMoreDigital
7th January 2007, 12:11
SMD: since you are happy with watching interlaced MPEG-4 files on your progressive screen I wonder which piece of hardware is doing the deinterlacing? Is it the player or the TV set itself? I would say, both the hardware player and the TV...
For a start, unlike LCD or CRT PC monitors, large LCD or plasma TV monitors have dedicated refresh rates primarily designed to display 50Hz PAL or 60Hz NTSC sources.
As far as my hardware player goes, it too offers dedicated refresh rates primarily designed to display 50Hz PAL or 60Hz NTSC sources.
Is deinterlacing quality of true interlaced content something that gets any attention in reviews of HDTV's for instance? For that matter, are there any websites out there that offer these kind of in-depth reviews?This is one of the reasons why the "interlaced" discussion was held over on the AVS forum. Looking back, I-O DATA's AVLP2 was one of the first hardware players able to offer playback of interlaced and/or progressive 1920x1080/88 MPEG-2, MPEG-4 and WMV9 sources and display them correctly. Something which is neigh on impossible to do with a PC software player/monitor combination.
We were lucky, somebody manged to find a really good pure interlaced 1920x1080 MPEG-2 (NTSC) source, ie: this one (http://www.mytempdir.com/1152260). Which could easily demonstrate the differences between a correctly or incorrectly generated MPEG-4 encode.
The main area we looked at were the railings on the train as it passed by.... I know which method of encoding I prefer to look at ;)
Cheers
Jay Bee
8th January 2007, 13:52
Thanks for the test clip. I guess I'm almost a year late to the train deinterlacing party but here goes anyway:
HINT: if you open the images in seperate tabs in Firefox you can compare them very efficiently by switching tabs with Ctrl+Tab and Ctrl+Shift+Tab.
1. MVbob
http://img6.picsplace.to/img6/24/thumbs/mv2.png (http://img6.picsplace.to/img.php?file=img6/24/mv2.png)
2. Nvidia Purevideo
http://img6.picsplace.to/img6/24/thumbs/pv2.png (http://img6.picsplace.to/img.php?file=img6/24/pv2.png)
3. CoreAVC/DirectShow
http://img6.picsplace.to/img6/24/thumbs/cd2.png (http://img6.picsplace.to/img.php?file=img6/24/cd2.png)
4. LeakKernelBob
http://img6.picsplace.to/img6/24/thumbs/lb2.png (http://img6.picsplace.to/img.php?file=img6/24/lb2.png)
Again the conclusions are pretty much the same:
-MVbob looks incredible but does have combing artifacts (middle-right).
-Purevideo comes closest and has no combing.
-CoreAVC/DirectShow is like Purevideo with more jaggies on the diagonal lines.
-LeakKernelBob has the most artifacts but is orders of magnitude faster than MVBob.
So basically I still think that interlaced videos should be kept interlaced since software deinterlacers that offer the same or better quality as hardware deinterlacers are just too slow to be practical. We just need better support for both encoding and decoding on the MPEG-4 software side and then we can at last give up MPEG-2.
Finally here's a rar with 3 AVC clips: 1080 MBAFF, MVbob 1080p60 and MVbob 720p60 so you can compare for yourselves. They all use half the bitrate of the original MPEG-2. To get the MBAFF file to deinterlace properly you will have to use the workaround I posted here (http://forum.doom9.org/showpost.php?p=890190&postcount=1768).
http://www.megaupload.com/?d=QCAFP6G5
The MVbob files are indeed impressive and the MBAFF file is pretty good considering it encoded 15x faster than the MVbob files. It could be better though if there were better AVC decoders/deinterlacers out there. Why hasn't Nvidia made one themselves yet? Their MPEG-2 decoder shows what they can do.
SeeMoreDigital
8th January 2007, 15:42
Sadly I can't play high-def MPEG-4 Part-10 encodes in hardware, only MPEG-4 Part-2 :(
But here's a link to one of my old "pure interlaced" 1920x1088 MPEG-4 SP encodes (http://www.mytempdir.com/1155652) (at just 2.77MB). Although it will look "pants" when viewed via most software players (VLC set to "bob" mode should yield fairly favourable results), it looks great when played/viewed via a suitably equipped hardware player...
Cheers
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.