View Full Version : DV Source Color Space
GParent
10th September 2003, 00:09
I am finally grasping the issue of color space and luminance. But I have a question regarding situations when you have to be a detective and track down source information.
In my case, what do Cable TV stations use to shoot and record studio events? They use a large professional analog camera. When they record, I am guessing its onto a analog or digital video tape which is then captured into a PC or Mac for editing and the final product transferred onto a MiniDV tape.
FIRST QUESTION:
If the original capture and/or editing had messed up the luminance or color space before you get it, what can you do to analyze or figure out what corrective action(s) can be done?
I know that captures usually do a YUV to RGB conversion, but can you capture in the native color space (DV = YUV) and run analysis on it before doing a RGB conversion?
SECOND QUESTION:
Is it worth recapturing using different Codecs and/or luminance ranges (0-255, 16-235) in the hopes of trying to figure out if the DV you were handed is compressed or not? Or, does it appear better using a different Codec?
STEPS I TOOK IN MY PROJECT:
(1) I installed the Matrox DV Codec (FOURCC 'dvsd').
(2) Did my MiniDV capture into Vegas 4 using the Matrox DV Codec to decompress.
(3) I wrote out the edited AVI using NTSC-DV (aka. Matrox Codec).
(4) Ran a AVS script for input into CCE Mpeg encoder. In the script was a ColorYUY2 conversion.
FINAL QUESTION:
Is the color space filter going to properly do the RGB32 to YUV conversion using the appropriate luminance conversion, or do I have to figure that out myself and add more parameters to my script?
communist
10th September 2003, 10:00
I think cable studio record their stuff mostly on betacam / DVCPROx / D9 (DigitalS).
Editing doesnt need to take place on mac / pc coz you can do it on editing vtrs too ;)
If they happen to use a NLE suite then the final goes back to one of the mentioned formats.
Q1:
If you transfer DV material from DV cameras / vtrs to your comp via 1394 then you're doing a lossless copy of your material. There are DV-codecs that you can use to capture (in YUV and RGB24) / playback. And by 'capture' I mean analog capture which doesnt involve 1394. When you 'capture' via 1394 then the codec is not involved.
Q2: No matter which codec you may have installed the capturing process via 1394 doesnt involve the codec AFAiK.
FredThompson
10th September 2003, 10:11
Originally posted by GParent
In my case, what do Cable TVNTSC?stations use to shoot and record studio events? They use a large professional analog camera. When they record, I am guessing its onto a analog or digital video tape which is then captured into a PC or Mac for editing and the final product transferred onto a MiniDV tape.sometimes, yes, sometimes, no, most likely not miniDVIf the original capture and/or editing had messed up the luminance or color space before you get it, what can you do to analyze or figure out what corrective action(s) can be done?What do you mean by "messed up"? There are various filters to adjust luma and chroma similar to the tuning controls on a TV. You can also look at various measurements like histograms. There are some professional tools for color correction.I know that captures usually do a YUV to RGB conversion, but can you capture in the native color space (DV = YUV) and run analysis on it before doing a RGB conversion?The primary reason most people who hang out at doom9 would use RGB is they are using VirtualDub or they have CGI source. RGB is a computer format, not a video format. If possible, avoid changing colorspace.Is it worth recapturing using different Codecs and/or luminance ranges (0-255, 16-235) in the hopes of trying to figure out if the DV you were handed is compressed or not? Or, does it appear better using a different Codec?Recapturing? "Capture" means the process of digitizing an analog signal. What you describe here is contradictory. Are you asking how to tell the luma range of a DV source which someone else has given you? What do you mean "compressed" DV? "Better" is not the appropriate word. DV codecs have different decompressors and perform differently. The majority of people who hang out here appear to be using an old Panasonic codec. This part of your question is very open to debate. Many claims have been made about the "quality" of the image coming from one codec vs. another. However, without a "reference" decoder, these claims are all subjective, not objective. I, personally, registered the MainConcept codec. It has many settings to limit range, swap fields, etc. which the free demo does not (because the demo is an old version.)
STEPS I TOOK IN MY PROJECT:
(1) I installed the Matrox DV Codec (FOURCC 'dvsd').
(2) Did my MiniDV capture into Vegas 4 using the Matrox DV Codec to decompress.What do you mean "capture"? Do you really mean you imported data from the DV tape or do you mean analog to digital conversion via a DV system?(3) I wrote out the edited AVI using NTSC-DV (aka. Matrox Codec).Define "edit." If all you did was cut and paste stuff, there's no reason to do create a file, do it with an AviSynth script.(4) Ran a AVS script for input into CCE Mpeg encoder. In the script was a ColorYUY2 conversion.
Is the color space filter going to properly do the RGB32 to YUV conversion using the appropriate luminance conversion, or do I have to figure that out myself and add more parameters to my script?Didn't you say you saved the edited version as a DV file? Why do you think that would be RGB? What do you mean "appropriate luminance conversion"? Are you asking if the luminence will be a restricted range? Are you asking if it will squish things outside such a range into a smaller one?
Bordo32
10th September 2003, 15:04
@Fred, I try to choose right codec for my DV to Mpg2 conversions. I am playing with DV codecs comparison (Canopus v1.02 versus the latest Mainconcept v2.4.4).
Just a quick question, how do you change MainConcept codec settings to frame serve through the Avisynth to CCE for example? I know if you open VirtualDub, in the Codec Config window you may change those settings, like RGB 16-235, Clamb YUV to ITU601r and such. But if you want use it just for the Avisynth, do those settings remain?
Thanks,
Bordo
FredThompson
10th September 2003, 17:44
yes
GParent
10th September 2003, 23:25
Hi Fred,
The studio used Premiere or Final Cut Pro. When asked for a copy of the edited video, they simply transferred their file onto a MiniDV.
>> What do you mean by "messed up"? <<
By messed up, I am referring to the original studio technicians who captured and edited (using a NLE) the video before I got it. Surely, there is a potential that RGB compression was not handled properly. I though perhaps a tool could detect such things.
>> Recapturing? "Capture" means the process of digitizing an analog signal. What you describe here is contradictory. <<
I use the word CAPTURE as it applies to the process of transferring a DV from a miniDV tape into a PC file using IEEE-1394. Both Scenealyzer and Vegas 4 use the term CAPTURE for that task. IMO, its just a Digital Capture.
>> Define "edit." If all you did was cut and paste stuff, >> there's no reason to do create a file, do it with an AviSynth script. <<
THE FOLLOWING ADDRESSES DETAILS OF STEP (3):
"I wrote out the edited AVI using NTSC-DV.."
After transferring the miniDV tape using Vegas Capture, I added 4 Video FX filters, did some deletes, a couple of moves, and a few cross fades. When done, I created an AVI file using the Vegas 4 RENDER AS. I picked the Vegas 4 TEMPLATE ==> "NTSC-DV" which used FOURCC code 'dvsd'. What is that on my PC? In my case, its the Matrox DV Codec.
>> Didn't you say you saved the edited version as a DV file? Why do you think that would be RGB? <<
Fred, my head is swimming from maybe reading one too many messages on this subject. If I had a penny for every time the luma compression vs non compression (16-235 vs 0-255) was batted around, I could buy a meal.
Tell me if I'm wrong, I'm here to learn.
I think that my NLE is working in RGB color space and saves the rendered AVI file using the Matrox DV Codec, which I think uses RGB. However, I am not 100% sure. In addition, if it worked in both RGB and YUY2, wouldn't Matrox offer a configuration option, like the HuffYUV Codec? In fact, I have not discovered a Matrox Config option.
>>What do you mean "appropriate luminance conversion"? Are you asking if the luminence will be a restricted range? Are you asking if it will squish things outside such a range into a smaller one?
<<
YES!
You've got it. IF my rendered Video is using the RGB format and I write an AVS script to convert it to YUY2 color space: ConvertToYUY2, does the RGB issue of PC vs TV luma range have relevance in the conversion process, or is it a non issue?
I guess this is the area I am stuck trying to understand, so I appreciate your help.
FredThompson
11th September 2003, 00:19
OK, now I understand.
DV is not RGB. Most NLEs, including Vegas, use RGB internally becuase it gives one set of values for each individual pixel. This is very good for some types of video processing, especially computer-generated effects.
The biggest challenge with NTSC DV is it's use of 4:1:1 color, meaning, one chroma value for 4 horizontal pixels. It doesn't play well with sharp edges or thin lines.
If at all possible, don't save processed video as DV, there will be significant degradation of quality.
What Vegas calls capture can actually take two forms, it may be some form of passthrough conversion or it may just be copying the digital stream from tape.
I'm not sure if Vegas will take frame-served input. But, let's assume it does or you have a compatible frameserver running.
If it were me, I would read the source data from the tape to a file. Then I would frameserve it to Vegas via an AviSynth script using Tom Barry's Reinterpolate411 filter (http://mywebpages.comcast.net/trbarry/), do all the edits, and frameserve FROM Vegas using Satish Kumar's PluginPac FrameServer (http://www.debugmode.com/pluginpac/frameserver.php) to a lossless file format or to a compressor.
That RGB luminence range of 16-235 if to match TV specs. Some equipment has a hard time with values outside this range. Colorspace conversion doesn't really expand or contract as you describe. However, if you have source with the restricted range and decompress it as if it has the full range, there will be a difference. The AviSynth command Limiter() might be what you are looking for.
As I said, there are all kinds of ways to adjust chroma and luminence aspects.
I don't think Vegas uses your Matrox codec. I'm pretty sure it has its own DV routines. It's been months since I asked tech questions of Sonic Foundry, though, so that might be incorrect.
GParent
11th September 2003, 14:18
I did two captures. A Vegas 4 Capture and I also did one with Scenealyzer which I believe is closer to purely reading across the Firewire and writing out a file. It only put an AVI wrapper around the untouched DV video and slaps the appropriate FOURCC code, namely, 'dvsd'.
Yes, I can frame serve into Vegas 4 and will give that a try.
NOTE: According to the Vegas 4 forum on Creative Cow, V4 is using its own Codec when it writes out an AVI file. Also, it DOES work in RGB mode and their is rumor of a future change to edit in the YUV domain, a much demanded improvement.
http://www.creativecow.net/index.php?forumid=24
FredThompson
11th September 2003, 15:44
Originally posted by GParent
I did two captures. A Vegas 4 Capture and I also did one with Scenealyzer which I believe is closer to purely reading across the Firewire and writing out a file. It only put an AVI wrapper around the untouched DV video and slaps the appropriate FOURCC code, namely, 'dvsd'.Firewire is a data format. If you tried to "capture" via firewire, you copied data from the tape.NOTE: According to the Vegas 4 forum on Creative Cow, V4 is using its own Codec when it writes out an AVI file. Also, it DOES work in RGB mode and their is rumor of a future change to edit in the YUV domain, a much demanded improvement.Yes, I told you that.
Bordo32
17th September 2003, 18:43
Thanks for the answer.
I try to learn how to process DV avi through the Avisynth.
Please give me an advice.
I have captured my DV avi from MiniDV tape with the Scenalyzer. I want to process an avi file in Avisynth 2.52, run an AVS script (Thanks to Fred, I will use Reinterpolate411() in my script!) in to CCE 2.66 encoder, and author mpeg files to DVD. I assume that the best way to do that, in order to get best quality on TV, is to keep luminance range 16-235, correct me if I am wrong. I know that the DV avi, captured from MiniDV tape, might have some overshoots below 16 and above 235 values (strange thing, a histogram doesn’t show it).
I am using MainConcept codec, should I check "RGB 16-235" and "Clamb YUV to ITU601r" in the Decoder settings? I really do not want to ask that, just want make sure that Decoder really means decompression? Is the "Fastest" remaining checked? I am not sure how the MainConcept codec behaves, does it expand luminance range to 0-255 or keeps it as is if those settings are unchecked. Or it squeezes range even more if they are checked?
Second othing. If a file needs to be rendered (saved) as DV avi by using MainConcept codec. What changes should be done in the Encoder settings, checked or unchecked "RGB 16-235" and "Clamb YUV to ITU601r"?
Do I need to check a "Luminance level box" 0-255 in CCE in order to keep a luma range untouched?
The third version. I frame serve an avi file through the Avisynth and Avi Wrapper Link2 to Vegas 4. After editing in Vegas 4 it is frame served to CCE encoder through the PluginPac FrameServer. Thanks for the info, now I know Vegas uses RGB.
Should I use at the end of my script ConvertToRGB, ConvertToRGB24, let Huffyuv codec to convert YUY2 to RGB, allow Link2 convert it (for some reason it works just when conversion to RGB24 is allowed) or Vegas will do that by it’s codec?
How may I make sure that luminance range will not be distorted?
Thanks for helping.
FredThompson
17th September 2003, 20:17
I don't use Scenalyzer and don't know if it messes with the luminence. Vegas will read DV and also has scene change detection.
Assuming Scenalyzer didn't change the luminence, your histogram shows a range of 16-235 so your source has that range or your camcorder only operates in that range.
Yes, MainConcept YUV decoder should be clamped (clamb is a translation error :P). If you don't clamp, it will expand the luminence to 0-255.
I'm not sure if it rescales or "cores", meaning, replaces all the under/over-sized values with the minimum/maximum.
Yes, I would set the encoder to clamp as well.
FWIW, I hate 16-235 range but if that is your source range, you should keep it.
I have been advocating smoothing in near-blacks and recently discovered ShadowSmoother is affecting other areas. Haven't yet found an appropriate smoothing which is also fast enough. The idea is camcorder and compression artifacts are very visible to the human eye with dark objects so smoothing it will help reduce false motion and noise.
Bordo32
25th September 2003, 23:58
Fred, thanks for replaying.
Do you keep the "Fastest" checked in the MainConcept encoder settings?
You have mentioned about the ShadowSmoother, I want give that a try.
I’ve seen your script for DV to CVD on Doom9. It is still not clear to me how to use it. Could you give an example how to use this VirtualDub filter in Avisynth along with the Convolution3D.
I’ve got my frame serving into Vegas 4 through the Link2 working properly. But at the end of my script I need put "ConvertToRGB" or check "Enable format conversion" and "RGB24" in the Link2 settings. It doesn’t work if I check "RGB32". I was wondering if I set a Huffyuv on my PC (changed huffyuv.dll in the registry) as a YUY2 codec I should be able to frame serve into Vegas without "ConvertToRGB" at the end of my script. I’ve read that it’s good thing to have the Huffyuv as the system YUY2 codec and it might convert from YUY2 to RGB before an avi gets into Vegas. Seems to me it is not happening.
Any suggestion what is the right way to do that?
@GParent, you have frame served to Vegas 4, what software do you use for that. What converts from YUY2 to RGB in your chain, Huffyuv, "ConvertToRGB" or Vegas does it?
I really appreciated all of your inputs.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.