Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > DV

Reply
 
Thread Tools Search this Thread Display Modes
Old 25th November 2004, 00:38   #41  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
I tried your plugin Wilbert but it doesn't really help.
The video looks like pixel-doubled after inserting 'ConvertToYUY2(interlaced=true)' (what is needed because DirectShowSource gives me YV12).
The source is PAL DV interlaced BUT edited with Adobe Premiere by a friend (who isn't very experienced with video codecs...).

This is my avisynth script:
Quote:
loadplugin("C:\Programme\AviSynth 2.5\plugins\kerneldeint140.dll")
DirectShowSource("E:\DVDRIP\TSC_DVD_#1\gtech3-raw-big.avi")
ConvertToYUY2(interlaced=true)
#ReInterpolate420(interlaced=true)
KernelDeint(order=0,threshold=6,sharp=true,map=false
Any suggestions?
I search the whole doom9 forum and tried out different things for hours but I just don't get the quality of your screenshots
__________________
Cya, abraxxa
abraxxa is offline   Reply With Quote
Old 25th November 2004, 21:50   #42  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
You shouldn't load it via ffdshow. The problem is that DV-YV12 and MPEG2-YV12 is sampled differently. This implies that the conversions DV-YV12 -> YUY2 and MPEG2-YV12 -> YUY2 (the latter is what avs does) should be done differently.

I will add 'DV-YV12 -> YUY2' one day to my filter, but don't have time now.

Bottom line, load your dv with avisource
Wilbert is offline   Reply With Quote
Old 25th November 2004, 23:47   #43  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
THANKS!
I knew that there is a difference but not which and i thought that 'eliminate chroma jaggyness of PAL-DV' is related to PAL-DV cam footage.
I used DirectShowSource() cause i have no vfw codec for AviSource() and DirectShowSource().info() shows me that its YV12 so I thought its ok.
I installed Sony DV codec 2.23 which outputs RGB24.
Quality is still bad
Now I found out that I have Canopus DV codec installed. (i don't know the version, it's the one shipped with Procoder 2.0).
But quality is still bad
Mainly the edges have a 'rainbow' effect

loadplugin("E:\Install\Video\AviSynth\ReInterpolate420\Release\ReInterpolate420.dll")
loadplugin("E:\Install\Video\AviSynth\KernelDeint_1.5.2\kerneldeint.dll")
AviSource("E:\DVDRIP\TSC_DVD_#1\gtech3-raw-big.avi", true, "YUY2", fourCC="CDVC").info()
#ConvertToYUY2(interlaced=true)
ReInterpolate420(interlaced=true)
#KernelDeint(order=0,threshold=6,sharp=true,map=false)

It also seems that ReInterpolate420 doesn't do/change anything...

What are I'm missing?
__________________
Cya, abraxxa

Last edited by abraxxa; 26th November 2004 at 00:51.
abraxxa is offline   Reply With Quote
Old 26th November 2004, 13:00   #44  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Could you upload a small clip (of about 25 frames)?
Wilbert is offline   Reply With Quote
Old 26th November 2004, 15:35   #45  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
No problem!

25 frames snip

You can see the effect on the edge of the roof of the halls in the background.
Is this a deinterlacing problem OR a choma problem?

Try it with this avisynth script:

loadplugin("c:\Install\Video\AviSynth\KernelDeint_1.5.2\kerneldeint.dll")
AviSource("c:\temp\gtech3_snip.avi", false, "YUY2", fourCC="CDVC")
KernelDeint(order=0,threshold=5,sharp=true,map=false)

I tried also with order=1 but that doesn't help either...
__________________
Cya, abraxxa
abraxxa is offline   Reply With Quote
Old 8th December 2004, 21:12   #46  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
*bump*

Had you time to look into my problem Wilbert?
__________________
Cya, abraxxa
abraxxa is offline   Reply With Quote
Old 8th December 2004, 23:52   #47  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Sorry, I forgot about it I will look at it tomorrow.
Wilbert is offline   Reply With Quote
Old 9th December 2004, 00:44   #48  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
Thanks!
__________________
Cya, abraxxa

Last edited by abraxxa; 12th December 2004 at 02:36.
abraxxa is offline   Reply With Quote
Old 11th December 2004, 14:12   #49  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
I have a Sony DSR-PD150P (PAL edition) and the Canopus playback-only codec installed. I want to rip the DV on the tape using WinDV, mark the avi as cdvc and then convert it to XviD.

I suppose I should do the following, right?

avisource("input.avi",pixel_type="YUY2",audio=true)
FixBrokenChromaUpsampling()
ReInterpolate420(interlaced=true)
ConvertToYV12(interlaced=true)
kerneldeint(order=0,sharp=true)
removegrain(mode=2)

Or should I remove "ReInterpolate420()" for the reason that I will convert it to YV12 later?
henryho_hk is offline   Reply With Quote
Old 11th December 2004, 14:22   #50  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
@abraxxa: I found nothing special with your clip.
The stairstepping is a very normal thing with interlacing.
Either use tdeint(mode=1, tryweave=false) instead of kernelbob() or start experimenting with mvbob()...

@henryho_hk: what do you intend to gain by the usage of:

ReInterpolate420(interlaced=true)
ConvertToYV12(interlaced=true)


your YV12 chroma will only be blurred unnesesary.

if you need YV12 out of an DV-AVI, open it via directshowsource() and enable ffdshow as DV-Decoder.
it will give you much better chroma...
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 11th December 2004, 15:40   #51  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
Quote:
Originally posted by scharfis_brain
if you need YV12 out of an DV-AVI, open it via directshowsource() and enable ffdshow as DV-Decoder. it will give you much better chroma...
I see. Does it mean that the YV12 output of the ffdshow decoder is free of these chroma glitches (even fixchromaupsampling)?

If I uninstall all other DV codecs, can I use the following instead of DirectshowSource?

AVISource("input.avi",audio=true,pixel_type="YV12",fourcc="DSVD")
henryho_hk is offline   Reply With Quote
Old 11th December 2004, 15:48   #52  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
this won't work.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 11th December 2004, 15:58   #53  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
Quote:
Originally posted by scharfis_brain
this won't work.
Too bad.... DirectshowSource does not always work in my computer, esp. on those big DV dumps.
henryho_hk is offline   Reply With Quote
Old 11th December 2004, 16:14   #54  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
maybe this function:

Code:
function reducetoyv12(clip x)
{
	u=x.utoy().separatefields().separatefields().selecteven().converttoyv12().weave()
	v=x.vtoy().separatefields().separatefields().selecteven().converttoyv12().weave()
	x=x.converttoyv12()
	ytouv(u,v)
	x.mergechroma(last)
	
}


avisource("dv.avi")
reducetoyv12()
kerneldeint(order=0,sharp=true)
removegrain(mode=2)
is good for your purposes.
the funmction reducetoyv12 reduces the YUY2 chroma to YV12 chroma using pointsampling insted of weighted blending, like converttoyv12(interlaced=true) would do.
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 11th December 2004, 16:53   #55  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
if you need YV12 out of an DV-AVI, open it via directshowsource() and enable ffdshow as DV-Decoder. it will give you much better chroma...
Nope, it won't. Like I said several times in this thread, DV-YV12 (pal) and MPEG2-YV12 are sampled differently. If you import it using DirectShowSource, and you either convert to another color format, or you just leave it as YV12 (and play it after encoding), your chroma will be messed up.
Wilbert is offline   Reply With Quote
Old 11th December 2004, 18:25   #56  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
I found out, that U and V of DV-YV12 seems to be stored as normal YV12 ?!?

at least, the processing as normal YV12 won't suffer from chroma misalignement in my tests..
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.
scharfis_brain is offline   Reply With Quote
Old 11th December 2004, 22:50   #57  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
I found out, that U and V of DV-YV12 seems to be stored as normal YV12 ?!?
The storage is the same (Y plane, V plane followed by U plane), but the sampling is different. You posted a link in the first thread, so you should know

YUY2 layout:

frame:
YC Y YC Y line 1
YC Y YC Y line 2
YC Y YC Y line 3
YC Y YC Y line 4

MPEG-2
YUY2 -> YV12 (interlaced subsampling)

frame:
Y_Y_Y_Y line 1t
C___C__ chroma of YUY2_lines (0.75)*1t + (0.25)*3t
Y_Y_Y_Y line 2b

Y_Y_Y_Y line 3t
C___C__ chroma of YUY2_lines (0.25)*2b + (0.75)*4b
Y_Y_Y_Y line 4b

DV-PAL
YUY2 -> YV12 (interlaced subsampling)

It think it's just point-sampled (ie chroma removed):

frame:
YV1_Y_YV1_Y line 1t; V of YUY2_line 1t
YV2_Y_YV2_Y line 2b; V of YUY2_line 2b
YU3_Y_YU3_Y line 3t; U of YUY2_line 3t
YU4_Y_YU4_Y line 4b; U of YUY2_line 4b
YV5_Y_YV5_Y line 5t; V of YUY2_line 5t
YV6_Y_YV6_Y line 6b; V of YUY2_line 6b

I'm not sure, if have to look that up.

Suppose you upsample that using ConvertToYUY2(interlaced=true) (thus MPEG-2) sampling. What happens?

Consider line 5t. The chroma will be recreated as
Code:
 chroma of YV12_lines (0.25)*1t + (0.75)*5t[*]
Thus V5 = (0.25)*V1 + (0.75)*V5 and U5 = (0.25)*U3 + (0.75)*U7.

While it should be

Thus V5 = V5 and U5 = (0.5)*U3 + (0.5)*U7. I think ...
[*] see http://www.avisynth.org/Sampling

Last edited by Wilbert; 12th December 2004 at 20:48.
Wilbert is offline   Reply With Quote
Old 11th December 2004, 23:31   #58  |  Link
scharfis_brain
brainless
 
scharfis_brain's Avatar
 
Join Date: Mar 2003
Location: Germany
Posts: 3,653
Hey Wilbert. It is not, that I don't know about this sampling stuff
(After I learned a lot while being in this forums )

but it seems, that reality and theory differ (like the 1.066 and 1.094 PAR for the PAL-Stuff)

after examining some videos (two different cams),
I think that the chroma is sampled like conventional YV12.
Knows the devil why.

If you own an DV-Cam (I do not. I am only the person, who processes the videos...)
You may print out an image containing pure blue background with pure red diagonal objects on it (lines, blocks or circles). then you make a short still standing video of this (well lightened) picture.
This would be IMO the only possibility to check, whether the Cameras follow the standard or not.

Natural video is not that suited for checking for half pel chroma displacements, I think.
So I came to that (probably wrong) conclusion that DV Cams are building conventional YV12.

I also want to mention, that the canopus DV-Codec samples a RGB-Input with standard YV12.

Also its point-upsampling is in the grid of standard YV12.
Which (the point upsampling) is NOT a bad thing, after doing some tests!
Most MPEG-2 Encoders need RGB (TMPGenc) or YUY2 (CCE etc..) input, which gets downsampled to YV12 again by averaging nearby pixels (not 100% correct, I know...).
With IDENTICAL nearby pixels like it is the case with point-upsamples DV, the chroma won't bleed.

but if the DV-decoder would to a proper visual (with averaging) upsampling to YUY2 and the encoder the downsampling to YUY2 the chroma is bleeded like hell....

reinterpolate420() is only needed, if heaviy image manipulation (destroying pixel structure) is wished (deshaking, resizing...)
for linear editing it is completely obsolete, IMO.

when I need to deinterlace the stuff, I am currently not 100% sure, whether I shall use

reducetoyv12().YV12deinterlacer()
(gives lowest chroma manipulation as possible!)

or

reinterpolate420().YUY2deinterlacer()
(chroma-artifacts of the deinterlacer are not that visible, chrom is slightly bleeded)

Wilbert, what do you think?
__________________
Don't forget the 'c'!

Don't PM me for technical support, please.

Last edited by scharfis_brain; 11th December 2004 at 23:38.
scharfis_brain is offline   Reply With Quote
Old 12th December 2004, 02:50   #59  |  Link
abraxxa
Registered User
 
Join Date: Nov 2004
Location: Vienna
Posts: 11
@Wilbert: What deinterlaced did you use for the posted pictures in this thread? I just don't get those stair-steps away...
__________________
Cya, abraxxa
abraxxa is offline   Reply With Quote
Old 12th December 2004, 07:04   #60  |  Link
henryho_hk
Registered User
 
Join Date: Mar 2004
Posts: 889
Quote:
Originally posted by scharfis_brain
maybe this function:
Code:
avisource("dv.avi")
reducetoyv12()
kerneldeint(order=0,sharp=true)
removegrain(mode=2)
is good for your purposes.

Thank you. As I will be using the Canopus codec, should I put
"FixBrokenChromaUpsampling()" back? Or is it unnecessary because of the YV12 point-sampling?

In addition, does "FixBrokenChromaUpsampling()" work for both NTSC and PAL DV?
henryho_hk is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.