VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    Hi everyone

    What function can I use to extract each of the YUV components: Y, U, and V ?

    I need to extract from the raw source, no conversions to something else and then.

    I know about the Greyscale() function, rec709 and rec601, but that will not give me what I actaully need. It basically blends channels and gives you no other user options.

    ShowRED, GREEN, and BLUE, are basically same as above, they blend channels or in this case, will give me an r, g, or b component, which is not what I am after.

    I did a quick look up and did not see any ShowY, ShowU and ShowV.

    If it helps, here are some examples I made with the ShowRED, ... functions, which is not what I'm looking for:



    * original image -> showRED converted


    * original image -> showGREEN converted


    * original image -> showBLUE converted


    Thank you.

    -vhelp 5306
    Quote Quote  
  2. Member
    Join Date
    Aug 2002
    Location
    Sweden
    Search PM
    Maybe some of these avisynth functions can be useful:
    http://avisynth.org.ru/docs/english/corefilters/swap.htm

    UtoY() would make a greyscale clip of the U channel.
    VtoY() would make a greyscale clip of the V channel.
    Quote Quote  
  3. For YUY2 video:
    Code:
    src=DirectShowSource("YUY2Video.avi")
    
    Y=ColorYUV(src,off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
    U=UtoY(src)
    V=VtoY(src)
    
    StackHorizontal(Y, U, V)
    Note that YUY2 video has U and V channels that are half the horizontal resolution of the Y channel. Y:U:V:



    For YV12 video:

    Code:
    src=DirectShowSource("YV12Video.avi")
    
    Y=ColorYUV(src,off_u=-256, off_v=-256).ColorYUV(off_u=128, off_v=128)
    U=UtoY(src)
    V=VtoY(src)
    
    StackHorizontal(Y, StackVertical(U, V))
    Note that YV12 video has U and V channels that are half the resolution, both horizontally and vertically, of the Y channel. Y:U/V:

    Quote Quote  
  4. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    While I do appreciate the tips on manipulating clip to show gray levels through ColorYUV and U/VtoY it does not seem to be what I'm looking for. This method leaves me wondering or doubting what my sources Y and U, V true value are. This is assuming from an analog capture project where I capture raw and no codec.

    I will continue searching through google for the answers. I know I've seen the answer on a forum board somewhere, but can't remember. But its looking like I may have to create the methods (the hard way) myself. Again, thank you for the above tips.

    -vhelp 5309
    Quote Quote  
  5. UtoY() and VtoY() simply copy the values from the U or V planes to the Y plane. The values you then see in the Y plane are then exactly the same values they had before being copied there.

    Setting U and V to 128 leaves you with perfect gray scale. The values in Y are untouched.

    These are exactly analogous to your ShowRed, ShowGreen, and ShowBlue where the individual primaries are converted to grayscale by copying one primary to the other two.

    If your frame is YV12 you can export as a binary file. You will then have three planes of data Y, U, and V. Remember that the U and V planes are half the resolution (both axis) of the Y plane.
    Quote Quote  



Similar Threads

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