VideoHelp Forum




+ Reply to Thread
Results 1 to 11 of 11
  1. I have few question about colorspace.
    Just to mention that i am in PAL land and only work(for now) with Pal sources.

    I am capturing VHS tapes with canopus 110 in DV(full Pal,interlaced) format. For decodind i use cedocida 0.1.7 or panasonic dv codec(can switch with Vcswap).

    My question is:

    1. When using cedocida codec for decoding and select option YUY2 in virtual dub sais:
    FourCC code:[YUY2] YUV 4:2:2, and for Decompressor:YUV 4:2:2 (YUY2). So why sais 4:2:2. Does yuy2 has 4:2:2 ? I aks this because does pal need to have 4:2:0 ?

    2. But when in cedocida codec for decoding i select YV12 in virtual dub sais:
    FourCC code:[YV12] Ati YVU12 4:2:0 Planar, and for Decompressor: Divx 6.4.0 YV12 decoder. So here i have 4:2:0 but why is decompressor divx codedc instead cedocida.

    3. Similar things is when using panasonic. For example when load avisynth script in virtual dub and add converttoyuy2(interlaced=true) i also have 4:2:2. So does yuy2 has 4:2:2. Is that correct to proceed in CCE?

    thanks
    Quote Quote  
  2. YUY2 is one way of storing 4:2:2.

    http://www.fourcc.org/yuv.php#YUY2

    It will be converted to 4:2:0 (YV12) when you encode (assuming that's what the encoder uses -- MPEG2 and Divx for example).
    Quote Quote  
  3. So its ok to be 4:2:2
    Code:
    YUY2 is another in the family of YUV 4:2:2 formats and appears to be used by all the same codecs as UYVY.
    My goal is to load that dv avi in CCE for encoding. But because i use yuy2 filters my last line is converttoyuy2(interlaced=true)

    So in my way it would be yuy2(4:2:2)-yv12(4:2:0) if i using cedocida codec. Does i need some reinterpolate filter or no?

    But what will be if we using panasonic dv codec ?
    Quote Quote  
  4. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    SerbianBoss,

    For what its worth nothing here with you, a couple of things..

    There are several types of formats for 4:2:2 and 4:2:0 sampling.

    For 4:2:2, THREE common types (or, Intervals) include:
    ** YUY2
    ** UYVY
    ** VYUY

    For 4:2:0, TWO common types (or, Planes) include:
    ** YV12
    ** i420

    The point of all these formats are there storage arrangements. The
    Y, U, and V color components are positioned inside the avi stream
    at different Intervals or Planes, depending on the format..

    ** if Intervals, then after every Y, a U is placed, then another Y,
    and then a V is placed, and this would continue throughout the avi
    stream..

    EXAMPLE: YUY2.422

    YuYv YuYv YuYv .. ..

    ** if Planes, then a block or matrix of all Y 's are placed inside
    the avi stream, and then the U block/matrix, and then the V, also..

    EXAMPLE: YV12.420 / i420.420

    YYYYYYYY
    YYYYYYYY
    YYYYYYYY
    YYYYYYYY
    uuuu
    uuuu
    vvvv
    vvvv

    Of course, when this is actually written out to an avi stream, the above
    would look something like this:

    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY uuuuuuuu vvvvvvvv

    or,

    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY vvvvvvvv uuuuuuuu

    When this avi (YUV) stream is decoded to RGB (for display) then, for every
    four Y 's, a U and V are calculated (de-sampled) together with each Y to
    re-form the image. The downside (though slightely) thanks to the integer
    math, is that there are some rounding errors (or loss) of the final image,
    but in general, you would not notice it.

    Having built my own RGB -> YUV conversion tool helps, though the above was
    off the top of my head
    .


    So, weather you have a YUY2; UYVY; or VYUY; you would have in your hands
    a 4:2:2 source. And, if you have a YV12; or i420; you would have 4:2:0
    source.

    -vhelp 4142
    Quote Quote  
  5. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    A few more things to note..

    When you are editing or filtering an AVI source ..
    for PAL or NTSC, the [422 or 420] sampling (at this stage) does not matter.

    However, when you are applying various filter plugins, (ie, AVIsynth) then
    you have to pay attention to the filter/plugin sampling requirements. Some
    filter/plugin require to be put into 422 sampling ( ie, YUY2 ) or another
    example filter/plugin might require to be put into 420 sampling ( ie, YV12 )

    But, what if you have an AVI source that is UYVY.422 ?

    If you remember, this is still a member of the 4:2:2 sampling, just in a
    different layout. But, the filter/plugin will still need to be adjusted,
    so you would have to apply a..

    convertToYUY2()

    ..so that the filter/plugin can work inside this color space layout.

    So, you are better off making sure that your avi source is in the format
    that you plan to work in, at the start. So, if you plan on using a bunch
    of filter/plugins made for YUY2, please be sure that you are creating your
    sources in this color space format.. ie, YUY2.

    If you can't control this, as in the example of DV, than you probably
    have several choices to consider..

    A: If your DV codec (decoder) allows for adjustment of output, then select
    the YV12, (if available) and if filtering is deamed necessary, then utilize
    those filters that work inside the YV12 color space. Then, send this
    YV12 source to your YV12-ready MPEG Encoder.

    AVIsynth pseudo code:
    avisource(filename.avi)
    convertToYV12() ## <-- use this, if not already in YV12
    .. do filtering ..


    To my knowlege, I think that HCenc/Quenc require YV12 sources, natively.


    B: If your main intent is to filter your DV source, and your options are
    YUY2 filter/plugins, then again, if your DV codec (decoder) allows for
    adjustment of output, then select the YUY2, if its available, and do your
    filtering, then, send this YUY2 source to your YUY2-ready MPEG Encoder.

    AVIsynth pseudo code:
    avisource(filename.avi)
    convertToYUY2() ## <-- use this, if not already in YUY2
    .. do filtering ..


    To my knowledge, CCE accepts YUY2 sources natively.


    C: If your main intent is to filter your DV source, and your options are
    RGB filtering and an RGB-ready MPEG Encoder, then again, if your DV codec
    (decoder) allows for adjustment of output, then select the RGB, if its available,
    do your filtering, then, send this RGB source to your RGB-ready MPEG Encoder.

    virtualDUB pseudo code:
    open filename.avi source
    .. do filtering ..


    To my knowledge, TMPGenc accepts RGB sources natively.


    When you are encoding to MPEG-2 ..
    For basic MPEG-2 encoding, the standard *finished* mpeg layout is YV12.420
    for PAL and NTSC.

    -vhelp 4143
    Quote Quote  
  6. Thanks for this explanation.

    Some filter/plugin require to be put into 422 sampling ( ie, YUY2 ) or another
    example filter/plugin might require to be put into 420 sampling ( ie, YV12)


    For example if we use Convolution 3d or Peachsmoother we want yuy2 colorspace(4:2:2) because this filters works in yuy2. So in decoder is better to select yuy2, right?

    To my knowledge, CCE accepts YUY2 sources natively

    So if cce accpets yuy2 natively its better to decode dv files to yuy2(for cce)


    For example if we have yuy2 source and apply convolution 3d filter and want to send in cce does is necessary that last line in code be converttoyuy2()


    Code:
    LoadPlugin("Convolution3d.dll")
    avisource("C:\Documents and Settings\Nenad\Desktop\Video 1.avi")
    crop(8,4,-8,-12)
    SeparateFields()
    odd=SelectOdd.Convolution3D (1, 32, 128, 16, 64, 10, 0)")
    evn=SelectEven.Convolution3D (1, 32, 128, 16, 64, 10, 0)")
    Interleave(evn,odd)
    Weave()
    AddBorders(8,8,8,8)
    ConvertToYuY2(interlaced=true) //does this line is neccessary if we have yuy2 source
    And one more. In this script where is good to put tweak filter. My source is Pal interlaced, so where i can put that filter for saturation,contrast,hue,brightness...

    And at the end CCE internaly convert to yv12 4:2:0(when making mpeg).
    Quote Quote  
  7. Assuming your DV decoder is outputting YUY2, ConvertToYUY2() on the last line isn't necessary because the video is already in YUY2 format.

    If your DV decoder is decoding to YV12 or RGB your script will generate an error at the first filter that requires YUY2 -- Convolution3D(). In this case you would add ConvertToYUY2() somewhere before Convolution3D().

    It's best to put Tweak() somewhere between Crop() and AddBorders(). Right after Crop() might be best so that Convolution3D() is working with a corrected image().
    Quote Quote  
  8. Assuming your DV decoder is outputting YUY2, ConvertToYUY2() on the last line isn't necessary because the video is already in YUY2 format.

    Ok, but when reading convolution 3d quide it sais that put converttouyuy() at last for CCE even if source is yuy2


    So if we have some complex script with sharpen,noise and other filters, Tweak filter will be best to put before all other filters ?
    Quote Quote  
  9. Originally Posted by SerbianBoss
    Assuming your DV decoder is outputting YUY2, ConvertToYUY2() on the last line isn't necessary because the video is already in YUY2 format.

    Ok, but when reading convolution 3d quide it sais that put converttouyuy() at last for CCE even if source is yuy2
    I don't know what guide you're reading. I don't see any reason to ConvertToYUY2() if the video is already YUY2. Maybe the guide is refering to the YV12 version of Convolution3d()?

    Originally Posted by SerbianBoss
    So if we have some complex script with sharpen,noise and other filters, Tweak filter will be best to put before all other filters ?
    There is no simple answer to this. It will depend on what you're doing. If you are increasing contrast and/or saturation I'd put Tweak() before other filters. Otherwise you may end up with posterization problems.
    Quote Quote  
  10. I read this quide:
    https://forum.videohelp.com/viewtopic.php?t=225951&postdays=0&postorder=asc&start=0

    Ok, for safety tweak color is better to stay before other filters.
    Quote Quote  
  11. I think if you ask FulciLives he'll tell you that ConvertToYUY2() is not necessary for that particular script.

    When he says "Please note that if you use CCE (as I do) then this line should change to: ConvertToYUY2(interlaced=true)" he was speaking in the general sense that you would use ConvertToYUY2() if your video wasn't already YUY2 and you were feeding CCE.
    Quote Quote  



Similar Threads

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