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?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 10 of 10
Thread
-
-
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:
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. -
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. -
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. -
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:
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 -
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)
What you really wanted was:
Code:y=avisource("d:/bacha/film/100eos5d/film/11.avi") y=ConvertToYUY2(y) info(y)
Code: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!
Similar Threads
-
is this YUV or RGB?
By marcorocchini in forum Newbie / General discussionsReplies: 2Last Post: 20th Apr 2014, 10:21 -
MENCODER: how to convert from YUV to RGB?
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 19th Dec 2013, 13:24 -
If I convert from YUV to RGB I loss quality?
By marcorocchini in forum Newbie / General discussionsReplies: 5Last Post: 20th Oct 2013, 18:50 -
conversion from yuv 422 to rgb 565
By akshith in forum Video ConversionReplies: 2Last Post: 28th Aug 2013, 07:01 -
YUV 4:2:0 to RGB
By toshyuki in forum ProgrammingReplies: 15Last Post: 8th Oct 2012, 12:12