PDA

View Full Version : XviD and interlaced video content playback


FabioMTPX
30th June 2006, 08:34
Does XviD support interlaced playback? On the changelog it said XviD core supports interlaced decoding. But when I play back the XviD encoded video (interlace encoded), it still has all the interlace artifact..... I know I can use ffdshow's built-in deinterlacer to get rid of these artifact, but I am just curious if XviD supports interlaced playback.

also I discover that, if I write video aspect ratio into the video stream, ffdshow ignores it and set the pixel aspect ratio to 1:1 (default). The video aspect only works with ffdshow disabled. Any solution to these two questions?

mediator
30th June 2006, 08:40
most likely the XviD DirectShow decoder filter doesn't flag the video frames as interlaced, that's why they get displayed progressively - with the usual combing artefacts.

foxyshadis
30th June 2006, 09:11
#1: It's interlaced (encoding interlaced-as-progressive looks horrible), but won't be deinterlaced by xvid, just decoded. And ffdshow has no automatic deinterlacer, you have to turn it on (unless you have DScaler installed and selected, which I think does).

#2: Splitter or player problem. Unless it's a buggy old ffdshow it shouldn't touch the AR at all, just pass it through to the renderer.

GodofaGap
30th June 2006, 09:28
If you want AR correction to work in ffdshow you need to enable overlay mixer in output settings. This is not a player or splitter problem.

sterlina
30th June 2006, 09:42
also I discover that, if I write video aspect ratio into the video stream, ffdshow ignores it and set the pixel aspect ratio to 1:1 (default). The video aspect only works with ffdshow disabled. Any solution to these two questions?

you write the AR in XviD configuration tab or in the container (Matroska...)?

SeeMoreDigital
30th June 2006, 10:24
Does XviD support interlaced playback? On the changelog it said XviD core supports interlaced decoding. But when I play back the XviD encoded video (interlace encoded), it still has all the interlace artifact..... I know I can use ffdshow's built-in deinterlacer to get rid of these artifact, but I am just curious if XviD supports interlaced playback. Over the years I've tried and tested just about every MPEG-4 direct-show decoder filter there is and sadly none of them support playback of "interlaced" sources :scared:

Thankfully, most stand-alone (hardware) players do though :D

Just in-case you did not know, when generating interlaced MPEG-4 (XviD) encodes from interlaced sources, don't perform any vertical resizing ;)


Cheers

GodofaGap
30th June 2006, 10:36
Over the years I've tried and tested just about every MPEG-4 direct-show decoder filter there is and sadly none of them support playback of "interlaced" sources :scared:

This is completely false, many do.

Only thing is that they don't always deinterlace, so you get combing effects.

SeeMoreDigital
30th June 2006, 11:13
This is completely false, many do.

Only thing is that they don't always deinterlace, so you get combing effects.So... they don't support playback of "interlaced" sources then, do they?

GodofaGap
30th June 2006, 11:16
Deinterlacing is not a requirement for decoding interlaced material, in some cases it might even be not desired (e.g. editing).

And ffdshow certainly provides means for deinterlacing.

SeeMoreDigital
30th June 2006, 11:27
Can you confirm GodofaGap.

Have you ever generated pure interlaced MPEG-4 (XviD) encodes from pure interlaced MPEG-2 sources?

If so... can you provide an sample?


Cheers

GodofaGap
30th June 2006, 12:10
Sure. I took a raw yuv file from here (ftp://ftp.ldv.e-technik.tu-muenchen.de/dist/test_sequences/601/) and encoded it with Avisynth+VirtualDub+XviD q4. Sample can be downloaded here (http://www.savefile.com/files/6051199)

Screenshots are made with VirtualDub using the ffdshow vfw decoder with deinterlacing turned on and off.

Original (620k) (http://img20.imageshack.us/img20/1286/xvidoriginal1sk.png), decoded as interlaced (492k) (http://img296.imageshack.us/img296/7563/xvidinterlaced7yb.png) and decoded and deinterlaced (419k) (http://img296.imageshack.us/img296/9138/xviddeinterlaced6vm.png).

Seems to work fine.

SeeMoreDigital
30th June 2006, 13:02
Screenshots are made with VirtualDub using the ffdshow vfw decoder with deinterlacing turned on and off.Okay...

Can you now explain how you would configure FFDshow's decoders so your sample play correctly in say, Media Player Classic?


Cheers

GodofaGap
30th June 2006, 13:11
Config screenshot (http://img49.imageshack.us/img49/7355/ffdshowdeint3ph.png)

Deinterlacing method is of course a matter of personal preference...

SeeMoreDigital
30th June 2006, 14:28
For some reason I'm unable to get your (.png) screen-shot to load...

GodofaGap
30th June 2006, 14:34
Works fine here. But if you just skim through the ffdshow decoding config it shouldn't be really hard to find 'deinterlacing'.

SeeMoreDigital
30th June 2006, 15:52
Indeed... but I want to see how you do it!

The problem is, there are no MPEG-4 direct-show filters that can handle interlaced encodes "automatically" - despite an interlaced flag being present within the stream.

unskinnyboy
30th June 2006, 16:39
Just to be clear here, SMD, how do you think the output should be?

Do you think that interlaced content should be deinterlaced by default by an MPEG-4 decoder? OR
Do you think that interlaced content should be displayed as interlaced itself by default?

GodofaGap
30th June 2006, 16:41
I just tick the option and select the deinterlacing method I want, what is there to see?

The problem is, there are no MPEG-4 direct-show filters that can handle interlaced encodes "automatically" - despite an interlaced flag being present within the stream.
Stop saying they don't handle them, they handle them fine. What you mean is: the decoders don't DEINTERLACE the video automatically. I don't know how any decoder could know if I want my output to remain interlaced or that it should deinterlace the output, so a completely automated system cannot exist. Technically deinterlacing has nothing to do with decoding. At all.

foxyshadis
1st July 2006, 02:06
Dscaler does it for DVDs. Have no idea how it works in ffdshow for playing other media types, but it does (presumably) have combing detection. It's not great deinterlacing, but hey, it's fast.

If you have a strong cpu you can always use tdeint(full=false,...) in the avisynth section.

Revgen
1st July 2006, 02:16
I'm always able to bob-deinterlace xvid vids that I've recorded with Dscaler when I play them back in VLC Player. It works fine for me.

FabioMTPX
1st July 2006, 07:29
My ffdshow version is built on 20th April 2006 SSE. I flagged interlaced encoding in XviD encoder configuration. MPEG4-modifier 1.3.4 also indicates the flag has been set. I also set up the aspect ratio in the XviD encoder configuration too. The container is AVI.

Also I discover there seems to be some problem with FFDShow/VSFilter/XviD). When ffdshow and VSFilters are both installed, (XviD 1.1.0 final is installed too) disabling ffdshow video decoding, and trying to play back the video with external subtitles (in .idx/sub format), windows media player loads, and then just halt there. Windows media player says it is playing back the video content, but the position bar stops at the beginning, and no sound and video come out (not even the first picture is shown). Once I move the subtitle files to somewhere else, then the video plays back fine. The video format is XviD, the audio format is mp3, and the container is AVI.

This is the software version:
Windows Media Player: 9
FFDShow: built on 20th April 2006, SSE
XviD: Koepi's version, 1.1.0 final.
VSFilter: 2.37
Matroska splitter: 2005-11-25

SeeMoreDigital
1st July 2006, 08:44
Just to be clear here, SMD, how do you think the output should be?

Do you think that interlaced content should be deinterlaced by default by an MPEG-4 decoder? OR
Do you think that interlaced content should be displayed as interlaced itself by default?I think an interlaced MPEG-4 source should be detected and de-interlaced automatically by the by the decoder.

Provided the MPEG-4 source is pure interlaced I would have thought a "Bob" de-interlacer should do as a default setting. VLC's (0.8.5) "Bob" de-interlacer seems to be pretty good and copes well with fast and slow moving scenes. However, for some reason I'm unable to get FFDshow to oblige in the same way, despite its massive collection of de-interlace settings: -

http://img301.imageshack.us/img301/4776/ffdshowdeinterlacingsettings8a.png


Cheers

Didée
1st July 2006, 12:32
What exactly do you mean by "unable to get FFDshow to oblige in the same way" ?

BTW, my settings for deinterlacing look more like

http://img329.imageshack.us/img329/2342/ffdshowdeinterlacing7lc.th.png (http://img329.imageshack.us/my.php?image=ffdshowdeinterlacing7lc.png)

DGBob is a little agy ... I like kernel bob more.

SeeMoreDigital
1st July 2006, 14:17
Jeez,

That's a lot of de-interlace options?

Can you tell me how you fair playing this pure interlaced 1920x1080 MPEG-2 source (http://www.one.seemoredigital.net/Temp_Files/Pure_Interlaced_HDTV_MPEG-2_Source.zip) and this pure interlaced 1920x1080 MPEG-4 encode (http://www.one.seemoredigital.net/Temp_Files/Pure_Interlaced_HDTV_MPEG-4_Encode.7z)?


Many thanks

Didée
1st July 2006, 16:35
With those PCs I'm working with -- not in any way. (Wanna sponsor me? :D )

SeeMoreDigital
1st July 2006, 17:17
Indeed....

I have had more success playing pure interlaced 1920x1080 MPEG-4 AVC encodes.... using CoreAVC 1.1 Pro (with interlaced support).

Given that decoding MPEG-4 AVC is more processor hungry than decoding MPEG-4 SP/ASP it would seem including interlaced support within the direct-show decoder itself, is well worth the effort ;)


Cheers

Jay Bee
6th July 2006, 18:15
Jeez,

That's a lot of de-interlace options?

Can you tell me how you fair playing this pure interlaced 1920x1080 MPEG-2 source (http://www.one.seemoredigital.net/Temp_Files/Pure_Interlaced_HDTV_MPEG-2_Source.zip) and this pure interlaced 1920x1080 MPEG-4 encode (http://www.one.seemoredigital.net/Temp_Files/Pure_Interlaced_HDTV_MPEG-4_Encode.7z)?


Many thanks

Actually there is a way to set ffdshow to do auto-deinterlacing. You need to activate "HW deinterlacing" under the "output" tab. This makes ffdshow pass the interlaced flag on to the renderer. I tried it on you test file and it worked but it wasn't quite as smooth as f.ex. MPEG-2 Purevideo. Not really usefull IMO if this is not the default setting though as this means that most people will not be able to playback interlaced files properly without somebody telling them how to setup ffdshow first.

Two years ago someone made (http://forum.doom9.org/showthread.php?t=79350)
a version of xvid that did auto-deinterlacing but for some reason not many people cared and it is no longer available.

CoreAVC does decent auto-deinterlacing but I haven't found an AVC encoder with all the options I want yet so ATM it's still XviD 50 fps progressive for me. What do you use for encoding interlaced AVC SeeMoreDigital?

unskinnyboy
6th July 2006, 18:39
CoreAVC does decent auto-deinterlacing but I haven't found an AVC encoder with all the options I want yet so ATM it's still XviD 50 fps progressive for me. What do you use for encoding interlaced AVC SeeMoreDigital?
Maybe you already know this, but x264 have had interlaced support for quite a while now, albeit limited (more info (http://forum.doom9.org/showthread.php?p=839734#post839734)). Some issues are still pending though..like 2-pass is b0rked etc. What options were that you wanted anyway?

Jay Bee
6th July 2006, 19:36
Maybe you already know this, but x264 have had interlaced support for quite a while now, albeit limited (more info (http://forum.doom9.org/showthread.php?p=839734#post839734)). Some issues are still pending though..like 2-pass is b0rked etc. What options were that you wanted anyway?

Yes, I was aware of that but as you say it isn't really mature yet.

What I want? A GUI, VDub-like editing, interlaced AVC encoding, mp4 output. That's all I can think of ATM. Maybe Avidemux will do this in the future? Or I could frameserve with Vdub and AVIsynth and use Elecard Mobile Converter? Havn't had time to try it yet. Or maybe just keeping TV recordings in MPEG-2 and using VideoRedo isn't a bad idea as storage is always getting cheaper albeit not as quickly as it used to. For now I'm using XviD and waiting to see how AVC further develops.

unskinnyboy
6th July 2006, 20:17
OK, so your issue is with AVC usage in general and not about the specifics of interlaced support. Apart for the VDub-like editing tool, everything else is already in place. But, yes, probably not in the same league as XviD yet.

Jay Bee
6th July 2006, 20:24
Yeah, exactly. Another thing about AVC is that nobody really knows for sure yet if files that are being encoded now will play without problems on future set-top boxes. But I am quite sure that AVC will at some point have all the software and features that you could possibly dream of, simply because of the fact that AVC will be widely used for HDTV, HD-DVD, Blu-Ray etc.

SeeMoreDigital
6th July 2006, 21:52
;) What do you use for encoding interlaced AVC SeeMoreDigital?I have not generated any of my own interlaced AVC encodes at the moment....

In-fact, I was hoping somebody could generate some for me from the HDTV MPEG-2 source I provided ;)

EDIT: XviD is able to generate brilliant looking MPEG-4 Part-2 interlaced encodes, when decoded in hardware.... Which is why I keep banging on about it.... Which is sadly missed by "software decoder" users


Cheers

Revgen
7th July 2006, 20:25
;)
In-fact, I was hoping somebody could generate some for me from the HDTV MPEG-2 source I provided ;)


A PAFF enabled version of x264 has already been released. Only works in 1-pass though. Here it is http://forum.doom9.org/showthread.php?p=839734#post839734

I encoded a sample with it and it works fine. I haven't tried HD material yet though.