VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. 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:
    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)
    Script 2:
    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)
    Quote Quote  
  2. Scripts look fine to me and I would have expected them to have the same output.

    The 2 scripts below do not produce identical outputs
    How did you compare them?

    Using:
    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)
    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,...

    At least:
    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)
    seems fine.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  3. Think I got it:
    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)
    seems fine.

    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 Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  4. Originally Posted by Selur View Post
    Scripts look fine to me and I would have expected them to have the same output.
    Yes, I thought the same …….

    How did you compare them?
    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 all

    I compare like this:
    Code:
    subtract(A,B).Levels(127,1,129,0,255)
    If A,B are identical this should give a homogeneous gray picture.

    Another check I made is like
    Code:
    A=A.converttoYV12(interlaced=true).colorYUV(analyze=true)
    B=B.converttoYV12(interlaced=true).colorYUV(analyze=true)
    stackhorizontal(A,B)
    You will see that the luma of A and B are almost identical but there are small differences with U and V.
    Not sure whether my test methods are really valid though.
    Quote Quote  
  5. you missed my last post.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  6. Originally Posted by Selur View Post
    you missed my last post.
    Yep indeed. Now it's ok. I pulled my hair.
    Does it affect your new release of Hybrid? Seems like issues always pop up just after a new release is out.
    Quote Quote  
  7. Does it affect your new release of Hybrid?
    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.)
    Will add an option to add the chroma placement.
    Seems like issues always pop up just after a new release is out.
    That just happens because then people play around more.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  
  8. Originally Posted by Selur View Post
    Will add an option to add the chroma placement.
    Can it perhaps be automatically added, based on the source analysis?
    Quote Quote  
  9. Can it perhaps be automatically added, based on the source analysis
    I could probably add it automatically if the source is DV or MPEG-1 video. -> I'll look into it.

    -> send you a link to a new dev version for testing

    Cu Selur
    Last edited by Selur; 1st May 2020 at 10:48.
    users currently on my ignore list: deadrats, Stears555, marcorocchini
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!