Log in

View Full Version : vdub dv decoder


billou2k
24th September 2004, 19:41
Hi,
I've got two issues regarding PAL DV play back and editing, I made several tests and experiments and looked through this forum but I couldnt find the cause of my problem.
I've extracted clips directly from my dv camcorder and I'd like to edit some short clips from it.
Playing the files directly with MPC and the default dvd decoder is perfect on the PC, vmr7 doubles the framerate making the video playing back at 50frames per second.
That same PC has a matrox G550 plugged on a TV.
This card display interlaced stuff perfectly on the TV.
However this time with the same file, the fields are played in the wrong order on the TV (whereas the video is perfectly smooth at double framerate on the PC)

That led me to try swap field with avisynth (I load the DV avi with directshowsource() and swapfields() ) But when I try swapfields, the motion is correct, but it's shaking vertically (sort of bobbing effect?)

Also trying to understand what's happening I opened the DV file both directly in Virtualdub 1.6.10 or with an avs in vdub ( I think the DV is type2 as it has audio too and doesnt open in vdubmod 1.5.10)
and here is what I saw by duplicating fields:
http://billou2k.free.fr/bak/dv/dv-vdub-internal-field1-duplicated.png
It seems that the colour components are not decoded properly in vdub and avs. It looks like the picture as been decoded as if it was a progressive 4:2:0 video whereas it is an interlaced 4:2:0.
Looking at the same frame with MPC (using the default dv decoder) and duplicating fields give me this:
http://billou2k.free.fr/bak/dv/dv-mpc-defaultdecoder-field1-duplicated.png
Here the colours are decoded the proper way.

Is there a way to make vdub 1.6 or avisynth decode interlaced DV properly or am I doing something stupid?

Also does anybody have an idea why the playback is jerky on the tv whereas it plays fine on the pc with double framerate?

Thanks a lot for any explanation you could give!

schmuh
28th September 2004, 15:20
There is a short explanation about "color interlacing" at http://www.100fps.com (search for "color interlacing" words and read below)

billou2k
28th September 2004, 17:34
Thanks for the link... but somehow I dont fully agree with the statement of this website:

To make things even more complicated, some digital camcorders have something you could call "color interlacing". While this term maybe somewhat inaccurate to describe the source of the artefacts, it is quite descriptive for the end result. interlaced Frame=Field1+Field2 as you can see clearly. But even after deinterlacing some red and some green pixels stay where the last field was.

As you can see on my captures, the default DV codec decodes it perfectly, so that cant be a faulty video captured by the camcorder. As I said I'm pretty sure it is just a matter of decoding the colour component properly (in interlaced yv12 stuff, 1 colour (1U+1V) is used for 4 pixels (2*2) of a field not of a frame.
Therefore when you decode a colour value in a interlaced YV12 video you need to apply it on 2 pixel of the current line and 2 pixels of the next line of the same field (or "next next" line of the frame)
A progressive YV12 doesnt have this.
So interlaced YV12 needs specific color decoding. If you apply standard YV12 progressive decoding you end up with my first screenshot or the ones on the 100fps site. I really dont think that is a camcorder problem. (On top of that it would be a ripoff :D )

After more tests, it appears that my first statement was wrong: opening an avs of the 420 video in vdub has the colours decoded properly. But opening the 420 DV video directly in vdub 1.6 doesnt and creates the artefacts showed on my 1st shot.

Also I still have the problem with the video being bottom field first. Is there a way to solve that problem to have a standard top field first video that could be played on a TV?

billou2k
28th September 2004, 17:52
Ok I've found the solution for the reversed fields problems.
In case someone is interested:
There is a plugin ReverseFieldDominance() http://www.geocities.com/siwalters_uk/reversefielddominance.html which transforms PAL DV into standard DV.
this filter reverses the field order by simply moving each line up (or down) by one line and duplicating the bottom(or top) line.
It has been discussed once before but I didnt know the proper terms and couldnt find it.
(its here: http://forum.doom9.org/showthread.php?s=&postid=268353#post268353 )