VideoHelp Forum

Try DVDFab and download streaming video, copy, convert or make Blu-rays,DVDs! Download free trial !
+ Reply to Thread
Results 1 to 10 of 10
Thread
  1. Hello guys, a total newbie got another question...

    I was trying to make my video (which was in RGB format) lighter with Tweak function and i got an error from Avisynth saying "Tweak: YUV data only (no RGB)". Could you please explain, what does this mean? Ive tried to read Avisynth documentation but havent found the answer. I suppose i should convert my video to YUV, but i wonder why Avisynth doesnt wanna work with RGB?
    Quote Quote  
  2. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    There are several Avisynth functions and filters that do work in RGB, but most use YV12 or YUY2. Most functions with the Tweak() filter work in YV12 and YUY2. Try Avisynth's function RGBAdjust(). Or import RGB directly into VirtualDub, whose filters are almost all RGB.

    The documentation that comes with most Avisynth filters usually indicates the colorspace(s) that the filter can use. Many video operations require some flavor or other of YUV. MAny of those filters work on the luma and/or chroma component separately, which can't be done with RGB. If you encode to standard formats such as DVD, BluRay or AVCHD, the video will be encoded as YV12. If you intend to mount videos on websites such as Utube, etc., RGB is not used.

    To convert to YV12 in Avisynth:
    for interlaced video: ConvertToYV12(intelaced=true)
    for progressive video: ConvertToYV12(interlaced=false)


    Last edited by LMotlow; 2nd Sep 2015 at 07:19.
    - My sister Ann's brother
    Quote Quote  
  3. When color TV was invented they needed a way to broadcast a signal that had color information but was also compatible with black and white TVs. The solution was to broadcast the colors (chroma, U and V, or Cb and Cr) separately (on a subcarrier) from the greyscale image (Y). This was a mathematical transformation of the RGB data, including rotating* and scaling of the axis:

    https://en.wikipedia.org/wiki/YCbCr

    On this page you can see a diagram of the RGB cube inside the YCbCr cube:

    https://software.intel.com/en-us/node/503873

    Black and white TVs would see the greyscale signal and display it correctly, color TVs would add the colors from the chroma channels.
    Quote Quote  
  4. Thank you, LMotlow, for such a quick reply and you, jagabo, for more detailed explanation. Your help is very appreciated.
    For some reason Avisynth refused to convert my video to YUY2 wih ConvertToYUY2 function, so i had to change the format while playing video in virtualdub, save this new avi file and now Avisynth seems to work fine with this file.
    Quote Quote  
  5. Originally Posted by spiritt View Post
    For some reason Avisynth refused to convert my video to YUY2 wih ConvertToYUY2 function
    To convert to YUY2 the width of the frame must be an even value. That's the only limitation I'm aware of. So you need to crop the width of the odd width frame by one column, or add a column. For example, either Crop(0,0,-1,-0) or AddBorders(0,0,1,0) before calling ConvertToYUY2().

    YV12 requires both the width and height of the frame be an even value.
    Quote Quote  
  6. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Umm, if it's YUV you have to crop by 2's, don't you? Can't crop YUV using uneven numbers. I don't think, anyway (corrections welcome). But you can add columns or lines in even or odd numbers with AddBorders to get even-numberd frame dimensions.

    The rules for Avisynth Crop (look at the table at the bottom of the page): http://avisynth.nl/index.php/Crop
    - My sister Ann's brother
    Quote Quote  
  7. YUY2 requires an even width but the height can be odd.

    Progressive YV12 requires an even width and an even height. And it must be cropped on even boundaries.

    Interlaced YV12 requires an even width and a mod4 height. And it must be cropped at even x positions, mod 4 y positions.

    YV24 can have odd widths or heights and can be cropped at odd boundaries.
    Quote Quote  
  8. I didnt suspect there was such deep theory underneath...

    The width is 1920 pixels, so its even and the function should work, if i have understood you correctly?

    Here's the piece of code that doesnt work:

    y=avisource("d:/bacha/film/100eos5d/film/11.avi")
    ConvertToYUY2(y)
    info(y)

    and here is some info which Avisynth returns about this file:

    colorspace RGB24
    width 1920 pixels, height 1080 pixels
    frames per sec 23.9760(24000/1001)
    fieldbased(separated) video no
    parity bottom field first
    video pitch 5760 bytes
    has audio no
    Quote Quote  
  9. Your script converts y to YUY2 but the result of that operation is "last", not y. Ie, when you don't specify the name of a clip the name "last" is used. Your script is equivalent to:

    Code:
    y=avisource("d:/bacha/film/100eos5d/film/11.avi")
    last=ConvertToYUY2(y)
    info(y)
    So you create a YUY2 video called last, but return info about the original video y.

    What you really wanted was:

    Code:
    y=avisource("d:/bacha/film/100eos5d/film/11.avi")
    y=ConvertToYUY2(y)
    info(y)
    or simply:

    Code:
    avisource("d:/bacha/film/100eos5d/film/11.avi")
    ConvertToYUY2()
    info()
    Quote Quote  
  10. Oh my god, I woldnt figure it out without your help...
    Everything is working now!
    Thank you so much!
    Quote Quote  



Similar Threads