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?
+ Reply to Thread
Results 1 to 10 of 10
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
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:
On this page you can see a diagram of the RGB cube inside the YCbCr cube:
Black and white TVs would see the greyscale signal and display it correctly, color TVs would add the colors from the chroma channels.
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.
YV12 requires both the width and height of the frame be an even value.
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
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.
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:
and here is some info which Avisynth returns about this file:
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
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:
y=avisource("d:/bacha/film/100eos5d/film/11.avi") last=ConvertToYUY2(y) info(y)
What you really wanted was:
y=avisource("d:/bacha/film/100eos5d/film/11.avi") y=ConvertToYUY2(y) info(y)
avisource("d:/bacha/film/100eos5d/film/11.avi") ConvertToYUY2() info()
Oh my god, I woldnt figure it out without your help...
Everything is working now!
Thank you so much!