rkr1958
5th November 2005, 18:29
I'm converting my son's Disney VHS tapes to DVD via DV camera passthrough to AVI CAP. The capture is AVI type 1. I have the pansonic codec loaded so I'm extracting the audio to wav using Virtualdub. I also use Virtualdub to identify the frames that I want to keep. I then build an AVS script to trim (i.e., keep) those frames. I'm then using CCE-Basic (2-pass VBR) to encode the video to .mpv. Finally ... my question ... which is preferred ...
(1) load, trim and convert the video to YUY2 then frameserve to CCE-Basic -- or --
(2) just load & trim then frameserve to CCE-Basic ?
Amnon82
5th November 2005, 19:36
Hope this will help You
How do I set the "Luminance Level" option correctly?
To make it short: it doesn't matter unless your video is in RGB format. I know some people will argue about that but I'll prove it below *).
MPEG1/2 (and that's what CCE encodes to) uses a color format called YCbCr which is vastly different from RGB. So CCE needs to convert RGB to YCbCr if the input clip uses RGB colors and does so by applying a conversion formula described in the CCE manual. The "Luminance Level" setting specifies a factor in this formula that controls whether the luminance range of the conversion complies with the ITU-R BT.601-5 standard (16-235, applicable for display on TV) or is more applicable for viewing on a computer screen (0-255). You decide what's best for your viewing application. But basically, if you want to retain the original luminance level of the RGB video, set it to 0-255 as 16-235 compresses down luminance.
So, how do you know if your video uses RGB colors? I know of only the two following scenarios where this can happen:
* You are frame serving a DVD2AVI project into CCE via VFAPI. VFAPI always converts to RGB. And this is also the only time where the YUV -> RGB Scale setting in DVD2AVI matters. Because DVDs usually already comply to the ITU-R BT.601-5 (16-235) standard, you will want to use "PC Scale" in DVD2AVI and "0-255" in CCE in this case to avoid any luminance compression.
* You are using the CCE Adobe Premiere plugin. Premiere feeds RGB video to the plugin and it depends on the DV codec used whether it performs any luminance scaling during the conversion. For instance, the Canopus DV codec has an option "Expand RGB range to 150%" for the YUV-RGB conversion which means luminance would be stretched to 0-255 during conversion. Again, you generally want to avoid any luminance scaling and set Luminance Level to 0-255 in the CCE plugin.
DVD2AVI projects frame served into CCE via AVISynth/mpeg2decX.dll do not use RGB but the YUV color space which is basically just another name for YCbCr. So no conversion takes place and you can ignore both the YUV -> RGB Scale setting in DVD2AVI and the Luminance Level setting in CCE.
*) Here is the proof: take any short clip you know is in YUV color format. For instance, the following short AVISynth script ensures you get a YUV colors clip:
Code:
ColorBars(720,480) ConvertToYUY2 Trim(0, 299)
Now encode that clip in CCE into two different files, use "0-255" for the first and "16-235" for the second encode. Perform a binary comparison of both MPV files (use a command line fc /b clip0_255.mpv clip16_235.mpv). They will be identical.
AVISynth 2.5.x and (interlaced) conversion from YV12 to YUY2
An important difference between AVISynth 2.0x and 2.5 is that naturally AVISynth 2.5 operates in the YV12 colorspace whereas AVISynth 2.0x operates in YUY2 (mandatory read: AVISynth YV12 FAQ). YV12 happens to be the native format used on DVD so one can expect a significant increase in speed when frame serving video originating from DVD VOBs because theoretically no color space conversion needs to be performed. Unfortunately for CCE users this is only half the truth because no version of CCE can currently natively read YV12 input, CCE itself can only decode RGB and YUY2. You'll have to add a
Code:
ConvertToYUY2(interlaced=true/false)
at the end of your script which unfortunately destroys most of the speed advantage. At least, even when using simple filters like Resizing, things are going to be faster than with AVISynth 2.0x, just make sure you put them before the color space conversion. The filters can obviously work simply faster in YV12 mode.
Note also that as shown above, ConvertToYUY2 in AVISynth 2.5.x has an optional 'interlaced=true/false' (default false) parameter used to ensure that interlaced coded video is converted correctly. It is important that you set this parameter right especially for interlaced coded video (example of incorrectly using ConvertToYUY2() for interlaced coded video, note the green stripes). I'm stressing the word coded here because that's what counts for ConvertToYUY2(), not what the video looks like in a software player. For instance, many DVDs are encoded interlaced although you can clearly see that the source material is progressive, i.e. no interlacing artifacts visible in DVD2AVI preview. So in case you are frameserving MPEG2 video, open the source MPEG/VOB in DVD2AVI and start the preview (F5). Watch the status window, if it mostly reports "Progressive", use ConvertToYUY2(), else if it's mostly "Interlaced", use ConvertToYUY2(interlaced=true). If in doubt, use ConvertToYUY2(interlaced=true) because it ensures interlaced coded material is handled correctly and the negative impact on progressive coded material is negligible.
However, one possibility to feed YV12 directly into CCE is some external codec that decodes YV12 data for it. This seems to work reliably only with CCE-SP 2.67.00.10 and newer, both DivX and XviD should do the job, as well as the lite version of the ffvfw codec included in the latest AVISynth 2.5 installers. In my tests however (using the ffvfw codec) and others, there seems to be not any difference in speed or even decreased speed compared to a ConvertToYUY2() in AVISynth. Also, the externals codecs may assume progressive video (at least DivX and XviD do) and mess up chroma for interlaced video for reasons outlined above. So for the time being, my advice is to stick to the conversion in AVISynth, eliminating another source for possible problems by minimizing the number of video processors involved.
rkr1958
7th November 2005, 01:24
Thanks for the info ... it's a good read. If I understood your post correctly, it doesn't really matter if I convert my AVI capture to YUY2 before frameserving to CCE-Basic.
Thanks again.
Amnon82
7th November 2005, 12:46
It depends on the CCE version you use and the one of AVISynth. The best is to try it your self. Your eyes are your best tool.
The post was only a copy and paste of the cce faq you can find in the sticky part of this forum. So the credit isn't mine ;)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.