I have some questions about colorYUV and how it relates to my conversion process in general. The AviSynth documentation describes the 'levels' parameter (from the colorYUV function) as such:
And then I found this description in the MergeARGB / MergeRGB function:levels can be set to either "TV->PC" or "PC->TV". This will perform a range conversion. Normally YUV values are not mapped from 0 to 255 (PC range), but a limited range (TV range). This performs conversion between the two formats. If nothing is entered as parameter, no conversion will be made (default operation).
Forgive me, but I cannot find the third quote I was looking for, but it basically said that when I capture in YUV, the range is 16-235 (the TV range described above). So does that mean I should convert to PC range before I encode to mpeg2 (for DVD authoring)? I guess a better way to ask is, should the video going into the encoder be PC range (0-255) or TV range (16-235)?All YUV luma pixel data is assumed to be pc-range, [0..255], there is no tv-range, [16..235], scaling. Chroma data from YUV clips is ignored. Input clips may be a mixture of all formats. YV12 is the most efficient format for transporting single channels thru any required filter chains.
In my own experiments, I tend to agree that my YUV captures are indeed in the TV range, and that a PC->TV conversion is not necessary, but now I am thinking that I might need to do a TV->PC conversion.
Thoughts?
Darryl
+ Reply to Thread
Results 1 to 6 of 6
-
-
You only need to worry about the luminance stretch/compression when converting between YUV and RGB.
If your source is YUV (as YUY2 or YV12 or somesuch) and you feed that to the MPEG encoder leave the luminance alone.
If your source is RGB (BMP images for example) you usually want to compress the luminance from 0-255 to 15-235. ConvertToYV12() and ConvertToYUY2() do this by default. If you are generating video test patterns and want to have patches of blacker-than-black and whiter-than-white, you can override the contrast compression by using the "matrix" options. For example, ConvertToYV12(matrix="PC.604"). -
I made 2 videos. One without ColorYUV(levels="PC->TV") and one with it. I played them back on my TV and the PC-TV one looked noticeably brighter. Is that normal and how can I remove the added brightness?
-
ColorYUV(levels="PC->TV") makes the darks brighter and the brights darker.
Stop using ColorYUV(levels="PC->TV"). It's only necessary for YUV sources that use the full 0-255 range for luma. There are very few such sources. Some MJPEG captures, Nikon still cameras, etc. Your DVD sources are already in the TV range. Analog caps you make should also already be in the TV range.Last edited by jagabo; 4th Apr 2013 at 07:38.
-
The reason I'm using ColorYUV(levels="PC->TV") is because for videos where I definitely need to adjust the gamma I found that the red text causes my encodings to use a higher bitrate than they actually need: ColorYUV(gamma_y=200, off_y=-32) and the PC-TV line prevents that from happening. Is there no way to remove the added brightness that ColorYUV(levels="PC->TV") adds?
-
ColorYUV(levels="PC->TV") gives you better compression because you're reducing the contrast. Less contrast --> less bitrate required. Use ColorYUV(cont_y=-256, cont_u=-256, cont_v=-256) and you'll get really good compression. You won't like the picture though.
You can use ColorYUV(levels="TV->PC") to undo what ColorYUV(levels="PC->TV") does. Of course, you'll be back to your original video, aside from rounding errors. It wont compress significantly differently than skipping all this PC/TV levels adjustments.
If you just want to make everything darker again you can use ColorYUV(off_y=-16). That will restore the black level to what it was before ColorYUV(levels="PC->TV"). Of course, the brights will get darker too. And you could have gotten pretty much the same effect by using a combination of only gain, gamma, and off in a single ColorYUV() statement, skipping the PC/TV levels change.
ColorYUV(levels="PC->TV") is roughly equivalent to ColorYUV(gain_y=-36, off_y=16, cont_v=-32, cont_u=-32).
Similar Threads
-
Set "Output filename" As Default Global "File/segment title" In MkvMerge?
By LouieChuckyMerry in forum Video ConversionReplies: 0Last Post: 9th Jul 2011, 01:52 -
What are Video "Profile Formats" or "Levels"?
By HanDuet in forum Newbie / General discussionsReplies: 2Last Post: 15th Mar 2011, 23:41 -
WMV files: Changing "Recorded Date", "Media Created" fields in metadata
By axhack in forum EditingReplies: 5Last Post: 18th Sep 2010, 01:27 -
"stretching" or "cramming" aspect ratio when I convert .avi to MP4
By Agent Bauer in forum ffmpegX general discussionReplies: 3Last Post: 21st Mar 2010, 10:30 -
Review "HYFAI" MP3/MP4 "Nano" clone from ebay
By NG in forum Portable VideoReplies: 29Last Post: 18th Sep 2007, 05:45