I have some mpeg 2 clips that I want to edit in a NLE. In order to edit these clips in Premiere Pro, first I have to decode them to lossless, using DGIndex, AviSynth, VirtualDub and Lagarith codec.
The mpeg 2 clips are generated by a consumer camcorder. I observed that some individuals that are specialists in video compression, or video editing, or other video processing tasks, are informing me (and others that want to edit video footage generated by their consumer camcorder), that SD consumer camcorders can not only exceed Rec.601, but they can also exceed RGB 0-255.
I would like to learn:
Q1. How to check if levels in a YUV clip exceed rec.601 and/or RGB 0-255 ?
Q2. If levels in a YUV clip exceed rec.601 and/or RGB 0-255, how do I correct it's levels so that they do not exceed rec.601 and/or RGB 0-255 ?
I will compress the decoded mpeg 2 clips with Lagarith in YV12 colorspace, to save hdd space. I understand that Premiere Pro works in YUV mode with DV clips, and in RGB mode with YV12 avi clips that were compressed with Lagarith.
I am still confused about what happens with levels when the imported avi clips are converted from YV12 to RGB by Premiere, and when the exported Premiere sequence is converted from RGB to YV12 by AviSynth:
Q3. After importing avi into premiere, levels YUV 16-235 are expanded to RGB 0-255 ?
Q4. After importing avi into premiere, levels YUV 16-235 are expanded to RGB 16-235 ?
Q5. After exporting the premiere sequence to avi, with Lagarith compression in RGB mode, and after converting that avi to YV12 with AviSynth with ConvertToYV12(matrix="Rec601"), levels will be contracted from 0-255 to 16-235, or clipped from 0-255 to 16-235 ?
Q6. After exporting the premiere sequence to avi, with Lagarith compression in RGB mode, and after converting that avi to YV12 with AviSynth with ConvertToYV12(matrix="PC.601"), levels will not be expanded nor contracted ?
And after I encode the avi to mp4 with h264 lossy compression, for delivery, I am confused about what happens with levels when that mp4 file is played back in MPC-HC, VLC, WMP, QuickTime:
Q7. If mp4 is YUV 16-235, levels are expanded to RGB 0-255 by the video player ?
Q8. If mp4 is YUV 16-235, levels are not expanded, but maintained at RGB 16-235 by the video player ?
What I am doing is I am following sanlyn's procedure and recommendations, and there is alot of confusion at first, since I don't have certain knowledge yet, to fully understand those recommendations, but I asked these questions because I don't want to make a mistake and unknowingly delete detail in the image, or cause the image to shift colors and tonality when it is imported in Premiere, and/or when it is played back on Windows and Mac.
Q9. Can you recommend books or documentation that could clear this confusion ?
Do not suggest to import the mpeg 2 clips in Premiere Pro. I already tried that, and found out that although Premiere accepts them, I had problems with performance and artifacts, because Premiere was not designed to work well with such highly compressed files, that are inter-frame/GOP/keyframe based. And on top of that, Premiere adds another generation of compression to those already highly compressed mpeg clips. Also, converting to DV and fixing levels in Premiere seems like an easier alternative, and I had no problems with performance or artifacts with DV, but I want to try Lagarith, because it uses lossless compression, and because the camera already compressed those mpeg 2 files for delivery, and maybe I can avoid another lossy compression to DV.
+ Reply to Thread
Results 1 to 6 of 6
-
Last edited by codemaster; 11th Sep 2013 at 19:09.
-
You can use this to check illegal values (but is not practical to my eyes):
MPEG2Source("D:\MyVideo.d2v", cpu=0)
converttoyuy2(interlaced=true)
ColorYUV(analyze=true)
ColorYUV(off_y=-35, gain_y=150) # brighten it up to create illegal colors
diff = Subtract(last, ConvertToRGB(last,interlaced=true).ConvertToYUY2(i nterlaced=true)).Levels(112,1,144,0,255)
return(StackHorizontal(last, diff)).VideoScope("bottom")
You need the filter videoscope see below:
http://avisynth.org.ru/docs/english/externalfilters/vscope.htm
Otherwise you can use this simple script:
MPEG2Source("D:\MyVideo.d2v", cpu=0)
ColorYUV(analyze=true)
If you want stay in the safe ballpark for chroma values try to set it around 212 max.
Why 212? try this script and will understand
function int2mode(int index) { return Select(index, "classic", "levels", "color") } #for HISTOGRAM
colorbars(width=720,height=480,pixel_type="YV12"). trim(0,7000) # rec 601 colorbars
changefps(29.970)
ColorYUV(analyze=true)
Histogram(int2mode(1))
You have to keep some room so you can adjust the saturation on tv and hit the magic number "240"*** DIGITIZING VHS / ANALOG VIDEOS SINCE 2001**** GEAR: JVC HR-S7700MS, TOSHIBA V733EF AND MORE -
I use VideoScope() or Histogram() to check levels. To get the customary horizontal graph from Histogram() use TurnRight().Histogram().TurnLeft().
If you want to see the picture without the usual rec.601 contrast stretch use ConvertToRGB(matrix="PC.601"). You can then use CSamp to read RGB values off the screen. -
In addition to the other suggestions, you can use premiere's waveform monitor if the asset is treated as YUV (see below) . If it's treated as RGB, it will already be clipped (already incurred that RGB conversion)
Q2. If levels in a YUV clip exceed rec.601 and/or RGB 0-255, how do I correct it's levels so that they do not exceed rec.601 and/or RGB 0-255 ?
I will compress the decoded mpeg 2 clips with Lagarith in YV12 colorspace, to save hdd space. I understand that Premiere Pro works in YUV mode with DV clips, and in RGB mode with YV12 avi clips that were compressed with Lagarith.
Newer versions of premiere handle YUV better (You have a YUV preserved workflow with YUV filters) . Even lossless intermediates like UT video are treated correctly as YUV . Applying an RGB filter (e.g. RGB curves) will cause RGB conversion in only those segments that it's applied to
I am still confused about what happens with levels when the imported avi clips are converted from YV12 to RGB by Premiere, and when the exported Premiere sequence is converted from RGB to YV12 by AviSynth:
Q3. After importing avi into premiere, levels YUV 16-235 are expanded to RGB 0-255 ?
Q4. After importing avi into premiere, levels YUV 16-235 are expanded to RGB 16-235 ?
Q5. After exporting the premiere sequence to avi, with Lagarith compression in RGB mode, and after converting that avi to YV12 with AviSynth with ConvertToYV12(matrix="Rec601"), levels will be contracted from 0-255 to 16-235, or clipped from 0-255 to 16-235 ?
Q6. After exporting the premiere sequence to avi, with Lagarith compression in RGB mode, and after converting that avi to YV12 with AviSynth with ConvertToYV12(matrix="PC.601"), levels will not be expanded nor contracted ?
Q8. If mp4 is YUV 16-235, levels are not expanded, but maintained at RGB 16-235 by the video player ? -
For example http://www.poynton.com/ - hard to find something better than His papers.
-
Sometimes it's easier to use different histogram styles than to try playing with a ton of numbers.
One source of confusion might be that YUV is a video storage technology, while RGB is a video display technology. The contrast and luma range of most YUV colorspaces is greater than that of most RGB display colorspaces. And again, PC display and TV display have differences as well, as you're probably aware. I use two types of histograms: YUV histograms to view the way video is stored as YUV, and RGB histograms to view the way that same video will display as RGB on either a PC or a TV.Last edited by sanlyn; 21st Mar 2014 at 14:11.
Similar Threads
-
Preparing this Rec.601 YV12 clip for Rec.709 MPEG-2 encoding
By fvisagie in forum RestorationReplies: 132Last Post: 26th Mar 2014, 17:38 -
avoid rec.709 -> rec.601 conversion in premiere pro and vegas
By codemaster in forum EditingReplies: 0Last Post: 21st Dec 2012, 03:47 -
How to fix changing brightness levels and stuttering with Avisynth?
By VideoFanatic in forum RestorationReplies: 27Last Post: 15th Oct 2012, 00:03 -
Is there a small test video one can use to test Rec 601 / 709 conversion?
By Asterra in forum Video ConversionReplies: 5Last Post: 19th Jun 2011, 08:28 -
Rec.709 to RGB24 to Rec.601
By Anonymous344 in forum Newbie / General discussionsReplies: 8Last Post: 2nd May 2011, 18:40