PDA

View Full Version : Interlace Shoot-out (DivX, FFVFW, VP6, WMV, XviD)


minolta
26th July 2004, 09:44
I've wanted to see an "Interlace Shoot-out" for some time now. The codecs of choice are DivX 5.2, FFVFW, MPEG-2, VP6, WMV9-AP, and XviD 1.0.1.

First part of the page is an intro to interlaced encoding...feel free to skip ahead to the shoot-out:

http://www.vrac.iastate.edu/~chadspen/interlace/index.html

Let me know of any errors,
-Minolta

p.s. Please don't turn this thread into a "oh joy, my fav codec is da best" :D. I still have the sources, so let me know if any improvements can be made.

lunaticmoon
27th July 2004, 09:59
As a means to treat hybrid material, I am interested in interlaced encoding.
To treat hybrid material, I think that it need interlaced encoding or progressive VFR (variable frame rate).
The interlaced encoding approach requires PC which can bear high drawing load, and effective de-interlacer. (on showing 60p)
However, interlaced encoding won progressive VFR at the realizable point easily for the user.

I am also applying a trial-and-error method in my viewpoint now. That theme is "interlaced encodeing vs. progressive VFR".

The wave of hybrid material has been accelerating in Japanese anime.
(The opening of "Full Metal Archemist" last week was also set to hybrid material at last.)
It is one of the means effective in interlaced encoding treating these videos.

btw, you show that RV10 interlaced encoding = NO, but I think it is possible by the present environment. Also interlaced decoding is possible as same as DivX approach.(using ffdshow RAW)

Would you teach why it claims "NO" on the recently page? :confused:

avih
27th July 2004, 10:47
i suggest adding ffdshow encoding (previously known as ffvfw) to the mix. in my experience it offers excellent interlaced encoding, with pre-capture-noise-filter (dscaler/mplayer), and achieves excellent results.

Sagittaire
27th July 2004, 11:34
WMV9-AP is very very very slow (in highest quality mode): 0.1 fps with very usual script in 640*272 ... !!!

RadicalEd
27th July 2004, 11:49
Originally posted by Sagittaire
WMV9-AP is very very very slow (in highest quality mode): 0.1 fps with very usual script in 640*272 ... !!!

Took me five hours to encode a minute and a half of footage. Five hours. Minute and a half. Yeah.

minolta
27th July 2004, 18:18
@lunaticmoon
With RV10, i've tried RealProducer and HelixProducer. Both had interlace options, but only to then deinterlace or IVTC. One could not specify 'keep interlaced'. Let me know...

@avih
I've made progressive ffdshow clips, but the interlaced one seems to encode/decoder wierd. I'll certainly try again. Can you quickly give some suggested parameters for low-bitrate and high-bitrate?

-Minolta

p.s. I should probably add encoding times to the stats. WMV9-AP was certainly the slowest. I think M$ plans on hardware encoders so didn't optimize?? It's their flagship codec for digital satellite/cable, so testing its interlace capability was interesting.

minolta
27th July 2004, 22:19
@avih
Found my problem w/ ffshow encoding. Two bugs actually:
1. b-frames are not decoded correctly with xvid decoder (shudders). Switching 4CC to FFDS is recommended.
2. 2-pass with b-frames chooses Q=31 for all frames (mentioned on forum before).

So to include ffdshow in the shoot-out i could:
1. disable b-frames for 2-pass (DivX w/ interlace does not use b-frames, so would be on par it).
2. enable b-frames, set 4cc to FFDS, and do a CBR

Neither option sounds too appealing. Any comments?
-Minolta

[edit]
I noticed in doom9 codec comparison a third option:
3. "constant quantizer (q=2) for the first pass writing the logfile, and CBR during the 2nd pass (selecting Use logfile in the output configuration)". not quite a true 2-pass, but perhaps very close. i'll try this out and update the shoot-out within next couple days.

avih
27th July 2004, 23:41
@minolta:

regarding xvid decoding: could be, i haven't tried. i don't think b-frames in avi files is preoperly defined anywhere. iirc, each encoder uses its own hack, although each decoder usually tries to be able to decode from other encoders.

regarding b-frames + 2-pass: didn't try that too. i mainly use ffdshow for PVR functionality (only for capture, one pass). the good thing is that it can do a LOT of things in real time, and still leave enough cpu for other tasks.

i'm able to capture about 400x576 interlaced ~1500kbps, with noise reduction using dscaler's adatpive noise remover, b-frames, interlaced, 4mv, in about 50%-80% cpu on my Athlon XP2500+ (i.e. about 80% for moto-gp races, that's a LOT of action). so the main advantage for ffdshow for me is that i'm able to capture with various filters in real time. other solutions require either capturing in [nearly/]lossless codec, then re-encoding, or capture and directly encode without real-time filters.

that's a major advantage for this kind of usage (PVR)

lunaticmoon
28th July 2004, 02:09
@minolta:

Although it may be wrong, if all de-interlace-related checks are removed by Producer and interlaced source is passed, I think that I am possible.(Producer option "-di" is not used.)

Detailed analysis has not been carried out although the output seems to hold the interlace as for me. Moreover, I have heard the talk of those who progressive-ize such an output via ffdshow and are looking at it.

Although I want to hear exact description of Helix member ... Don't they visit here? :D

minolta
28th July 2004, 05:14
@lunaticmoon

I encoded interlaced video with helix. Overall, the video was better than I thought, but artifacts remained:

http://www.public.iastate.edu/~chadspen/rv10sample.jpg

The picture is a single field (top 352x240 field of 352x480 frame). The horizontal lines in the picture should not be there. Other encodes did not have this problem.

Therefore, interlace is not supported in rv10. I do not want to misrepresent rv10 by including it in the shoot-out (screenshots do not look good).

Would any helix develelopers care to comment?
-Minolta

lunaticmoon
28th July 2004, 06:42
@minolta

Thanks for a quick test.

Since I was not so much well versed in English, although only general meaning was able to be read, is interlaced encoding of present RV10 all right at recognition of not being not much very well?
(About an on-the-spot photo at least.)

I like the general appearance of RV10Normal (NOT Ellysian).
(My observing point is Anime chiefly.)

However, though regrettable, in Progressive VFR, RV10 of the present condition is not so good. :(

What is the interlaced encoding codec of your recommendation by reference in the case of Anime?
(By the Anime of hybrid material, interlaced encoding which can be treated without being conscious of it is convenient.)

Please also peep into my thread, if interested also about hybrid material. (Although it is an animation relation chiefly :D)

http://forum.doom9.org/showthread.php?s=&threadid=78948

Valeron
28th July 2004, 07:21
Originally posted by Sagittaire
WMV9-AP is very very very slow (in highest quality mode): 0.1 fps with very usual script in 640*272 ... !!!

Please remember it's just a very very early,beta,even not a official beta version but just the decoder side is ready and shiped with the Windows Media Runtime 10 beta.
I mean the encoder is not ready yet.

minolta
28th July 2004, 07:52
@lunaticmoon

I edited my previous post for clarity (RV10 is _not_ interlace-ready).

I have never encoded anime or much hybrid, just truly-interlaced or progressive. So, I'm not familiar with VFR or hybrid techniques. If you want to encode entirely as interlaced, decide for yourself from my shoot-out (I'll refrain from recommending since I'm impartial).
-Minolta

P.S. I tried joining together an interlaced 4:3 and progressive 16:9 xvid clips:

http://www.public.iastate.edu/~chadspen/joined.avi

Use Windows Media Player and my custom xvid.ax filter (http://forum.doom9.org/showthread.php?s=&threadid=79350) for playback. The VMR auto-deinterlaces and auto-resizes (non-hybrid related, but cool anyway) on-the-fly. Unfortunately, the avi container prevents VFR. It is cool that this works, but very painful process for longer videos. Don't know of too many automatic methods besides real-producer and wmencoder, but these are not perfect either.

billou2k
28th July 2004, 12:48
Hi Minolta this shoutout is a great idea, I hope that could help people in some way to reconsider their opinion about interlacing!
I just have a question: you say
" Beware, deblocking of DivX and XviD decoders did not clean large blocks in many screenshots. Indeed, switching to the ffdshow decoder certainly helps and should perhaps be used for testing"
I've got a matrox card plugged on the TV and interlaced videos are played flawlessly on the TV so I could play a bit with the post processing effects of different decoders. Using Divx and Xvid PP didnt cause problems however as you noticed xvid's PP did leave some blocky parts very visible.
However I observed some weirds effects using FFDshow post processing with interlaced material.
Particularly using NIC's method it looks like the video is post processed as if it was progressive therefore degrading the fields and creating jerky motion. It didnt happen with mplayer's method but it guess it could if it processes the whole frame rather than the fields... Do you know how it works?

minolta
28th July 2004, 17:21
@billou2k

I tried my samples with ffdshow, but did not notice any blending of fields from post processing (even had them turned up all the way). Tried the SPP, which should definitely blur everything, but individual fields are still visible. You may be correct about Nic PP, but my quick tests have not indicated anything major.

However, I did notice something very disturbing with all tests (even with PP turned off):

http://www.public.iastate.edu/~chadspen/xf.jpg

The left is xvid and right is ffdshow. Frame is of a scene change. Images have been deinterlaced via simple line doubling (Photoshop). The ffdshow picture clearly has color bleeding from the other field. Probably a color space YV12 thing. Perhaps this is what you are noticing?

Don't get too woried about ffdshow. Once you manually deinterlace, the fields are correctly separated and no color bleeding. But for tv-out, perhaps should stick with original decoders.
-Minolta

billou2k
28th July 2004, 20:09
Quite weird effect indeed. Probably again an interlaced yv12 effect :(

I posted my captures with ffdshow with no pp, nic's pp, mplayer's pp, and spp.
http://billou2k.free.fr/video/encoding/interlaced/2x2.sub.jpg
It'sprobably difficult to comment with just the 4 shots next to each other (without the video playing on a TV) but as I said with FFDshow and no pp or mplayer's pp the playback seems fine but with nic's it's got a weird effect: not as bas as deinterlacing jerky effect but still not as smooth as the video without pp.
By looking at the shots you can see that some at some places the lines fields have been removed so I guess that's what creating these jerky artefacts...
I inluded the shots with spp which smooths everything out apart from the very strong lines... however I get 2 fps playback with it enabled? can you get it played real time 25fps/50hz??

By the way what do you mean by "if you manually deinterlace" (you mean with photoshop?)

I dont mind using xvid decoder especially now that you put the frame rate doubler in so I could watch interlaced stuff properly even on the pc now. But the deblocking seems very weak (at least on the video I tried) and I couldn't spot any difference when it was enabled or not.

BTW: using your xvid decoder dll, I got the bottom half part of the video black when I resize on the fly to a lower resolution than the original one. It's not really a problem as I dont leave it smaller but it happened to crash the system (windows went back to 640*480*16 colors..weird) once while resizing (I can't post a screenshot for that as irfanview cannot capture in overlay mode)

Leak
28th July 2004, 20:23
Originally posted by billou2k
I inluded the shots with spp which smooths everything out apart from the very strong lines... however I get 2 fps playback with it enabled? can you get it played real time 25fps/50hz??

You need to drag the slider right under "Presets" to the left - with SPP, it doesn't control what kind of deblocking/deringing is done (even though the checkmarks appearing under "Custom" might suggest otherwise), but IIRC it chooses how many ways the DCT blocks get smoothed and averaged, with every tick you move the slider to the right doubling the number of smoothings.

I always use the slider position 2 ticks to the right of the beginning, it doesn't eat all CPU and looks quite good, without smoothing the hell out of the image.

np: Kit Clayton - Aspoket (Nek Sanalet)

minolta
28th July 2004, 21:01
i see what you mean with nic's pp. it seems to be blending between fields. you might ask the ffdshow croud if PP operates on fields (when interlaced) or always the whole frame.
-Minolta

p.s. by "manual deinterlace" i meant checkmarking "deinterlace" in ffdshow. in this case the taxi-cab field did not have color bleeding (checked using dscaler 'bob' to analyze fields). you see the yv12 color stripes when played weaved normally, but deinterlace correctly separates yv12 frame. difficult to explain...

with xvid crash, are you using vmr9? i don't use vmr7, but heard it has some problems (none quite as severe as your's, however).

avih
28th July 2004, 23:41
@billou2k:
you can't watch interlaced clips without deinterlacing them!!!! what r u trying to achieve? removing interlacing artefacts without deinterlacing?

check the "deinterlace" box in ffdshow, and then enable dscaler from the deinterlacing panel. then from the left pane, click the dscaler item just below deinterlace, and select a plugin (prefferable bob for really fast action, and tomsMoComp 1/2 for the rest).

if u don't have dscaler installed, then just download the zip from here (http://sourceforge.net/project/showfiles.php?group_id=7420&package_id=75021). i suggest 4.18 if u also have a tv-card, since iirc 4.19 had issues with certain tv cards. then point ffdshow to thge unzipped dscaler dir, and select a plugin.

a world of difference.


ps.
the different between the internal deinterlacing of ffdshow and the dscaler ones, if that the internal ones don't double the framerate as required when properly deinterlacing (except for experimental bob), while the dscaler plugins do.

karl_lillevold
29th July 2004, 01:13
I am afraid there is no efficient way to encode interlaced content in the current RealVideo encoder. By default it will try to auto-deinterlace or inverse telecine interlaced content. These pre-filters are possible to turn off, but then encoding efficiency is very poor for interlaced content with high motion. Native interlace support in RealVideo may appear in a future episode..

lunaticmoon
29th July 2004, 06:46
@karl_lillevold

It is sad for me ... :(

I like the appearance which RV10 takes out.
However, I am groping for the Hybrid Material Encoding technique.

It will not work, supposing it will be as your information, if it says in the viewpoint of interlace maintenance.
If it says in the viewpoint of progressive VFR, the environmental adaptation de-interlace option and DropDupe of RV10 have also achieved the satisfactory results which do not go.

The way only seems to leave behind me pursuing the capability of other codecs for it in the present condition.

Although it seems that pursuit of the quality of image in the high bit rate is a focus with the present development indicator of RV10, isn't there any plan of such functional expansion in a road map?

billou2k
29th July 2004, 13:11
Leak: Indeed it plays real time now by bringing the preset slider to 1 or 2. thanks for the tip;-)

Minolta: Well I only use VMR7 because that is the only output device apart from the hardware overlay that plays the video fullscreen on TV with the matrox card.
About "manual deinterlace" Ok I think I get an idea of what you mean. you mean that by using ffdshow without deinterlacing you get that colour problem. And it is only fixed by enabling the ffdshow deinterlacing? does it mean there is something wrong in the decoding ? something like the UV associated with the wrong Y (progressive YV12 decoding instead of interlaced YV12 decoding?)

avih: As I have a TV, my main goal is not really to deinterlace (although if I also can watch interlaced content on the PC that's great)
I'm not trying to remove the interlaced artefacts ... as they are not artefacts;-) I'm just trying to post process the video the proper way.. on a field base rather than on a frame base. And it looks like ffdshow only works on a frame base therefore degrading the fields and creating some sort of unwanted deinterlacing that causes movement artefacts on the tv.

Now about watching on the pc screen, I've had a look at dscaler a long time ago but there is something I dont quite understand with all the deinterlacing methods existing?
Don't we just need what minolta just did for the xvid decoder? : double the frame rate and bob the fields ? that way we get the original movement impression and no horizontal lines right?

For the playback deinterlacing I don't understand why some keep 25fps ( by blending or doing whatever else) as it ruins the original motion where as doubling the frame rate seems much better.
I don't mean to offend anyone at all as I know many people work on this, but I hear about motion estimated deinterlacing etc... Can you explain me what is the advantage of that or any other technique over minolta's one?

minolta
30th July 2004, 08:29
updated page with FFVFW encodings...

@billou2k

The problem with YV12 is it cannot properly handle interlaced material. YV12 color is determined by 2x2 (or 2x4, i forget) grouping. A proper output format for interlaced frame is YUY2. The xvid decoder outputs YUY2, but others YV12 and have artifacts (WMV9, FFDSHOW). Internal per-field format can still be YV12, just output format. This is especially easy to notice with strong red colors. However, most often I don't really notice anyway. I'm no expert, anyone else explain??

You might give the dscaler plugins a second try (via ffdshow deinterlace). Of course, 'bob' is fast but not the best 60/50p deinterlace. The 'TomsMoComp' deinterlacer actually operates at 60/50p (unlike avisynth version). Its a pain since manual, but for ultra-HQ playback on your monitor, this is as good as it gets.
-Minolta

billou2k
30th July 2004, 12:16
I've looked at YV12 interlaced a bit and from what I understand it is possible to do things properly with interlaced videos but it implies doing things differently than in YV12 progressive and it seems that some decoders dont do it properly. The problem is that it is still being called YV12... doesnt seem very clever to me...
In YV12 you code 1 U and 1 V for a block of 2*2 Y vales. As you said there is a clear problem when it comes to interlaced videos because that way you will code the same colours for two lines who belong to 2 different fields
The proper way to encode and decode YV12 when the content is interlaced is to consider two lines of the same field (1 every 2 lines) rather than two consecutive lines. And you ve got to do it both at the encoding and the decoding side if you dont want to end up with some crappy colour artefacts.
Does ffdshow behave differently between progressive and interlaced YV12?

The even biggest problem with YV12 interlaced is that even if you do things properly you'll have situations where it creates visible colour artefacts... terrible system...

Another problem is that opening a YV12 interlaced avs will be messed up in vdub as I think the default YV12 decoder assumes it is progressive so you have to "converttoYUY2(interlaced=true)" at the end of the script.

Ok I'll give a try to dscaler for the pc playback
Althought it doesnt solve the post processing issue with ffdshow for the playback on tv of interlaced videos;-) as I said I wouldnt mind using the xvid standard decoder but the post processing seemed very weak with it (not that I am fond of post processing... I prefer not to use it most of the time but if I want to keep the video interlaced I have to keep it full size and therefore with 1.5mbps you start getting problems if you dont deblock a bit ;-)

McoreD
31st July 2004, 15:39
Originally posted by Sagittaire
WMV9-AP is very very very slow (in highest quality mode): 0.1 fps with very usual script in 640*272 ... !!!

Sagittaire, it is a bug in the build 3473. Later builds do not follow this problem.

E.g.
Content duration: 00:01:41:27 (dd:hh:mm:ss)
Session duration: 00:08:04:03 (dd:hh:mm:ss)

Until Microsoft releases another public build it is advisable to continue using WMV9.