The 2 scripts below do not produce identical outputs. Is this expected behavior due to the lossy YUY2->YV12 conversion, or is one (or both) of the scripts flawed?
Script 1 converts the interlaced frames to YV12
Script 2 converts the separated fields to YV12
Script 1:
Script 2:Code:AviSource=YUV422.avi #720x576i, yuv422 interlaced converttoYV12(interlaced=true) Even = AssumeFrameBased().SeparateFields().SelectEven() Odd = AssumeFrameBased().SeparateFields().SelectOdd() Interleave(Even,Odd).Weave() converttoRGB32(interlaced=true)
Code:AviSource=YUV422.avi #720x576i, yuv422 interlaced Even = AssumeFrameBased().SeparateFields().SelectEven().ConvertToYV12(interlaced=false) Odd = AssumeFrameBased().SeparateFields().SelectOdd().ConvertToYV12(interlaced=false) Interleave(Even,Odd).Weave() converttoRGB32(interlaced=true)
+ Reply to Thread
Results 1 to 9 of 9
-
-
Scripts look fine to me and I would have expected them to have the same output.
How did you compare them?The 2 scripts below do not produce identical outputs
Using:
it looks like you are right the histogram seems to be shifted by one line, but I'm not sure whether 'Histograms_in_RGB_&_CMY.avsi' (http://avisynth.nl/index.php/Histograms_in_RGB_%26_CMY#HistogramRGBParade) is suited for interlaced content,...Code:LoadCPlugin("I:\Hybrid\32bit\avisynthPlugins\ffms2.dll") Import("I:\Hybrid\32bit\avisynthPlugins\Histograms_in_RGB_&_CMY.avsi") # loading source: F:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\YUV422_sample.avi # input color sampling YUY2 # input luminance scale tv A= FFVideoSource("F:\TESTCL~1\files\INTERL~1\INTERL~1\YUV422~1.AVI",cachefile="E:\Temp\avi_1deca8d5573c8cb8cd8489678b764f38_853323747_1_0.ffindex",fpsnum=25,colorspace="YUY2") B = A A = A.ConvertToYV12(matrix="Rec601", interlaced = true) AEven = A.AssumeFrameBased().SeparateFields().SelectEven() AOdd = A.AssumeFrameBased().SeparateFields().SelectOdd() A = Interleave(AEven,AOdd).Weave() A = A.ConvertToRGB32(interlaced = true) BEven = B.AssumeFrameBased().SeparateFields().SelectEven().ConvertToYV12(interlaced=false) BOdd = B.AssumeFrameBased().SeparateFields().SelectOdd().ConvertToYV12(interlaced=false) B = Interleave(BEven,BOdd).Weave() B = B.ConvertToRGB32(interlaced=true) D = A.HistogramRGBParade ().Subtitle("Histogram A") E = B.HistogramRGBParade ().Subtitle("Histogram B") return Interleave(D,E)
At least:
seems fine.Code:LoadCPlugin("I:\Hybrid\32bit\avisynthPlugins\ffms2.dll") # loading source: F:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\YUV422_sample.avi # input color sampling YUY2 # input luminance scale tv A= FFVideoSource("F:\TESTCL~1\files\INTERL~1\INTERL~1\YUV422~1.AVI",cachefile="E:\Temp\avi_1deca8d5573c8cb8cd8489678b764f38_853323747_1_0.ffindex",fpsnum=25,colorspace="YUY2") B = A A = A.ConvertToYV12(matrix="Rec601", interlaced = true) AEven = A.AssumeFiedBased().SeparateFields().SelectEven() AOdd = A.AssumeFrameBased().SeparateFields().SelectOdd() A = Interleave(AEven,AOdd).Weave() A = A.ConvertToRGB32(interlaced = true) BEven = B.AssumeFrameBased().SeparateFields().SelectEven().ConvertToYV12(interlaced=false) BOdd = B.AssumeFrameBased().SeparateFields().SelectOdd().ConvertToYV12(interlaced=false) B = Interleave(BEven,BOdd).Weave() B = B.ConvertToRGB32(interlaced=true) C = Subtract(A, B).Subtitle("DIFF") A = A.Subtitle("A") B = B.Subtitle("B") return Interleave(A,B,C)
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Think I got it:
seems fine.Code:LoadCPlugin("I:\Hybrid\32bit\avisynthPlugins\ffms2.dll") Import("I:\Hybrid\32bit\avisynthPlugins\Histograms_in_RGB_&_CMY.avsi") # loading source: F:\TestClips&Co\files\interlaceAndTelecineSamples\interlaced\YUV422_sample.avi # input color sampling YUY2 # input luminance scale tv A= FFVideoSource("F:\TESTCL~1\files\INTERL~1\INTERL~1\YUV422~1.AVI",cachefile="E:\Temp\avi_1deca8d5573c8cb8cd8489678b764f38_853323747_1_0.ffindex",fpsnum=25,colorspace="YUY2") A = A.AssumeBFF() B = A A = A.ConvertToYV12(matrix="Rec601", interlaced = true, ChromaOutPlacement ="DV") AEven = A.AssumeFrameBased().SeparateFields().SelectEven() AOdd = A.AssumeFrameBased().SeparateFields().SelectOdd() A = Interleave(AEven,AOdd).Weave() A = A.ConvertToRGB32(interlaced = true, ChromaInPlacement = "DV") BEven = B.AssumeFrameBased().SeparateFields().SelectEven().ConvertToYV12(interlaced=false, ChromaOutPlacement ="DV") BOdd = B.AssumeFrameBased().SeparateFields().SelectOdd().ConvertToYV12(interlaced=false, ChromaOutPlacement ="DV") B = Interleave(BEven,BOdd).Weave() B = B.ConvertToRGB32(interlaced=true, ChromaInPlacement = "DV") D = A.HistogramRGBParade ().Subtitle("Histogram A") E = B.HistogramRGBParade ().Subtitle("Histogram B") return Interleave(D,E)
Important thing is setting 'ChromaInPlacement' when converting to Yv12 and setting 'ChromaOutPlacement' when converting to RGB32. (Didn't first think of this since I haven't filtered DV content for ages,...)
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
Yes, I thought the same …….
The differences are small and difficult to see by interleaving or subtraction alone. So in practice they should not really matter, I think. I was just wondering as to why there is a difference at allHow did you compare them?
I compare like this:
If A,B are identical this should give a homogeneous gray picture.Code:subtract(A,B).Levels(127,1,129,0,255)
Another check I made is like
You will see that the luma of A and B are almost identical but there are small differences with U and V.Code:A=A.converttoYV12(interlaced=true).colorYUV(analyze=true) B=B.converttoYV12(interlaced=true).colorYUV(analyze=true) stackhorizontal(A,B)
Not sure whether my test methods are really valid though.
-
you missed my last post.
users currently on my ignore list: deadrats, Stears555, marcorocchini -
Yes, this would affect all previous releases of Hybrid, including the latest. (Like I said I never use DV content so I never stumbled of this.)Does it affect your new release of Hybrid?
Will add an option to add the chroma placement.
That just happens because then people play around more.Seems like issues always pop up just after a new release is out.
Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini -
-
I could probably add it automatically if the source is DV or MPEG-1 video. -> I'll look into it.Can it perhaps be automatically added, based on the source analysis
-> send you a link to a new dev version for testing
Cu SelurLast edited by Selur; 1st May 2020 at 11:48.
users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
-
ffmpeg yuv colorspace is BT.601 or BT.709?
By colibri in forum Newbie / General discussionsReplies: 13Last Post: 22nd Dec 2019, 02:00 -
Screenshots and respect of the YUV>RGB colorspace conversion
By abolibibelot in forum Video ConversionReplies: 15Last Post: 3rd Nov 2018, 18:37 -
colorspace conversion
By hanaluluelle in forum Video ConversionReplies: 3Last Post: 29th Mar 2017, 11:02 -
Colorspace Conversion Questions
By Cuddlefish in forum Software PlayingReplies: 2Last Post: 15th Mar 2017, 18:20 -
UTvideo colorspace conversion
By chummy02 in forum Video ConversionReplies: 9Last Post: 28th Feb 2017, 18:15


Quote