I'm new to this, so please bear with me. I'm trying to open a dv file in Virtualdub which I captured from VHS using Pinnacle Studio 12. The video in virtualdub has all kinds of crazy color, though - everybody is blue and purple. I'm assuming that it is due a wrong setting for color depth. Under video>color depth>Decompression format in virtualdub, Autoselect is ticked. Here's where I am confused. If I drop the file in mediainfo it tells me the colorimetry is 4:1:1. But I don't see that as an option in virtualdub. How can I find out if the video file is RGB or something else (YUY2)? If I select 4:2:2 YCbCr (YUY2) it looks okay, but it also looks okay if I select some other choices, so I don't want to select the wrong one. I'm assuming I don't want to leave it on Autoselect do I, since the colors are all weird.
Also, I want to run it on full processing mode. Keeping in mind that the file I imported is a DV capture from VHS, I would like to export it with the same dv quality. What should I select under compression? It lists Canopus DV, and also Uncompressed RGB/YCbCr, as well as many others. I would like to keep the file from losing quality as best as I can.
+ Reply to Thread
Results 1 to 30 of 80
Okay, I selected "Prefer internal video decoders over installed third-party codecs", and that seemed to do the trick. Thanks, much appreciated!
What should I select under compression? I would like to export under the same DV codec as originally captured by Pinnacle, but I don't know what codec Pinnacle uses for DV. Does anybody know? Gspot says "dvsd" codec and "DVC/DV Video" under Video, and Mediainfo says "Digital Video (Sony)". I've read some DV codecs have a chroma upsampling bug.
Last edited by sasuweh; 29th Sep 2010 at 18:12.
Well, I actually captured the DV from a VHS using analog cables and the Dazzle capture device. I just found a simple Avisynth script that displays the file info over the video, and it seems that the colorspace is listed as YV12. I'm new to this so I don't know if that's good or bad. I installed Cedocida like you recommended. When I select it under compression and click configure in VirtualDub, under "YV12 chroma sampling" I have 3 choices. Since my files are apparently YV12, this seems important. I can choose from:
MPEG 2 non-interlaced
MPEG 2 interlaced
These same options are under both Encoder and Decoder settings.
My VHS>DV captures are DV interlaced. So would I select "DV" then? And will there be any loss in quality by using this codec? My goal is to make a DVD after I run it through VirtualDub.
Also, under Encoder - "RGB to YUV conversion", I have 2 choices:
and under Decoder - "YUV to RBG conversion", I also have 2 choices:
What should I use?
From what I understand, VirtualDub will automatically use RGB mode when using "Full processing mode", which is what I will be doing. I found another thread in this forum also talking about Cedocida, but I'm really confused over how VirtualDub converts to RGB. It seems from what I've read that it's a bad idea to work with VHS DV transfers in VirtualDub because of how it converts to RGB. Should I just avoid it altogether then?
Last edited by sasuweh; 29th Sep 2010 at 21:03.
EDIT - Decided to start a new thread for a different question.
Last edited by sasuweh; 30th Sep 2010 at 04:38.
I believe that CCE not handling YV12 natively is very old information that once applied to now very old versions of CCE because it'll open YV12 sources these days with no problems.
It's true that it'll convert them internally to YUY2 if it's not in YUY2 already. Me, I prefer that AviSynth do the conversion before feeding it into CCE. For interlaced DV sources you might add:
to the bottom of your scripts. For progressive videos, leave out the 'Interlaced=True'.
Last edited by manono; 30th Sep 2010 at 06:03.
That's the problem with trying to research this stuff - sometimes you find old information and don't know it. This sort of leads into the other question that I asked about colorspace in the other thread. I am very confused over whether or not my DV AVI is YV12 or something else entirely, but from what you've said, it shouldn't make a difference if I use that script for CCE, right? This is my first time using a script, too. Have I got this right?
So I just save that as an avs file (with the AVI location of course) and open it with CCE and then select my settings?
I appreciate the help.
The script is OK. Since CCE doesn't handle the audio, and if you have audio in it, you might do it this way:
AviSource("C:\file.avi",False)#means to disable the audio, if any.
I always handle my audio separately and bring it back in when authoring.
No, none at all, but what was the source audio, the one in the DV AVI? Isn't it WAV audio also?
Yes, VirtualDub does its filtering in RGB. It converts YUV video to RGB with a rec.601 conversion matrix which includes a contrast stretch from Y=16-235 to RGB=0-255. That means you will lose blacker-than-black (Y<16) and whiter-then-white (Y>235) and precision in between. Your YUV source isn't supposed to have Y outside the 16-235 range but captured video often does. If necessary, you can work around this with Cedocida by setting it to decode to RGB (disable the YUV options) without the contrast stretch. In the decoder section set YUV to RGB conversion [0-255] -> [0->255]. Then for output you have two options: adjust your video so it ranges from RGB=0-255 and use the usual rec.601 YUV to RGB conversion matrix in Cedocida (RGB to YUV conversion [0-255] -> [16-235]), or adjust your video to range from RGB 16-235 then use the pc.601 matrix in Cedocida (RGB to YUV conversion [0-255] -> [0-255]). Most other compression codecs (Xvid and Panasonic DV Codec, for example) don't give you these options and will always use the usual rec.601 matrix. So you have to adjust RGB to range from 0-255 when using those codecs.
Regarding the chroma subsampling, VirtualDub does has a problem with interlaced YV12 input. It handles it as progressive instead of interlaced when it converts from YV12 to RGB for filtering. That causes colors to blur between the two fields. PAL DV usually uses YV12 internally, so you potentially have problems. Again, you can work around them by forcing Cedocida to convert to RGB while decoding.
I don't have any native PAL DV video. Could you provide a small, sharp, colorful sample with significant motion (enough to see combing, but not so much that it's very blurry)? I'm pretty sure you want to set the YV12 chroma sampling to DV in Cedocida.
Last edited by jagabo; 30th Sep 2010 at 08:36.
Last edited by sasuweh; 30th Sep 2010 at 13:44.
why are you using virtualdub ? are you using some processing or filters in vdub?
if you do all your filtering in avisynth, you can feed it directly into CCE with avs script, without the colorspace conversions, and no intermediate files or quality loss from exporting out of vdub (as a 2nd generation lossy DV-AVI intermediate)
Well, I'm not sure that I want to use VirtualDub. It does sound like there are a lot of conversions involving RGB that I'd rather avoid. The only reason I'm considering running through VirtualDub is I noticed in VirtualDub it takes my VHS transfers, which usually have rather dull, light-gray blacks, and darkens the blacks up nicely in full processing mode. Is there a simple Avisynth script I can add when I run it through CCE that will accomplish the same thing? That is really the only need I have for VirtualDub. I know there might be a script for AviSynth I can use, but I have no idea what that would be. If I could just darken those blacks, I'd be happy and just feed the script directly into CCE and avoid VirtualDub altogether.
You can use histogram() or videoscope() in avisynth to visualize legal levels, and use levels or smoothlevels to adjust the black level. You can use avsp to visualize (push f5)
If you need a hand, post a small sample and someone will help you out configuring proper levels
AviSynth's equivalent of Cedocida's [0-255] -> [0-255] conversion is ConvertToRGB(interlaced=true, matrix="PC.601"), and the inverse ConvertToYV12(interlaced=true, matrix="PC.601").
The loss of precision converting from YUV to RGB and back isn't that big an issue (it does slow things down a bit). But, as has been pointed out, you could perform your filtering in AviSynth to avoid conversion to RGB altogether. GUI tools like AvsP can make it a little easier to set up.
Okay, so I just tried this out to see - If I use this AviSynth script:
and load it into VirtualDub, just to see how the video looks, the blacks are darker, more like what I'd like to see. If I use the full script as posted above:
and load that into VirtualDub, then the blacks are lighter, it look like the original file.
So, if I want to avoid VirtualDub and use ConvertToYUY2(interlaced=true) for CCE, what would I put in to achieve the same effect as ConvertToRGB(interlaced=true, matrix="PC.601") above?
And yes, the DV AVI files I'm working with are NTSC.
I wouldn't just blindly use a PC matrix . You might be making illegal video (<16, >235) which will clip whites and crush blacks on a DVD player. I would look at videoscope() or histogram() to make sure you are making legal video, and use levels or smoothlevels to adjust it accurately . Histogram() is easier to use, you just have to adjust it so the video levels are between the brown bars (small excursions are ok, but basically anything in the brown areas are illegal)
What you see on a PC monitor is usually different that what you see on a TV . They use different levels and are calibrated differently
I'm not familiar with capturing though pinnacle; is it adding any processing or are you doing any editing /filters in that? Do you get the same results capturing through windv?
It is not adding any processing that I know of. No filters. Just a straight capture.
I'm still not sure if my DV AVIs are YV12 or YUY2. It seems to be safe I should use the ConvertToYUY2(interlaced=true) for CCE. By the way, I have found a filter for AviSynth called PeachSmoother which seems to do a pretty nice job from a preview I tried playing in media player classic. Can this be used in CCE using the following script?
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\PeachSmoother.dll")
I've heard some filters may not work in CCE because multiple passes may produce varying results, which could cause a crc error in CCE. Sounds like another problem I'd rather not deal with, but it would be nice if I could try out this script and see the results from CCE.
Not sure if this tells you anything, but if I load the above script into CCE, and check the file properties, it lists the filename as the script file, and lists the FourCC and Pixel Format as YUY2. Does that mean the original AVI is YUY2 or is that because I have ConvertToYUY2(interlaced=true) in the script and it's doing it's job?
Last edited by sasuweh; 30th Sep 2010 at 16:25.
NTSC DV is 4:1:1 chroma subsampled. What colorspace it comes out of the decoder depends on what the decoder and editor negotiate (the best colorspace that both of them support). NTSC DV usually comes out YUY2 or RGB. You can use Info() to determine the video properties anywhere in an AviSynth script (the information is "printed" onto the video). One thing I like about Cedocida is you have the ability to force the output colorspace.
I think PeachSmoother always produces the same outout, given the same input.
Okay, I've tried a number of tests, and I'm still getting nowhere fast. One thing I've noticed, if I open the DV AVI files directly in CCE, and check file properties, under Source info, it lists:
Pixel format: RGB24
as I posted above, if I open the file using the AviSynth script, Source info says:
Pixel format: YUY2
So does this mean the original DV AVI files are RGB24?
These observations mean whatever vfw decoder you have installed for DV-AVI is set to decode RGB
The reason why the avs script shows YUY2 , is because you have ConvertToYUY2()
If you are using avisynth, you should set your decoder to output YUY2, otherwise you will incur YUY2=>RGB=>YUY2=>YV12 conversion . If you set it to output YUY2, you won't incur that extra RGB conversion. Since this is NTSC DV, you shouldn't even need ConvertToYUY2(interlaced=true), because it should already by YUY2 if the decoder is set properly
So then I should be able to just open the file as is in CCE? Okay, but how do I know what decoder is being used and how to set the output?
If you open a DV AVI directly in VirtualDub you can use File -> File Information to see what VFW decoder is the default (unless you've set VirtualDub to use its internal DV decoder). AviSource() in AviSynth should use that same decoder.
Attached is a levels test pattern I made a while back as DV AVI (in a ZIP file). It contains luma levels from 0 to 255. When viewed on TV all the levels below 16 should be equally black. All the levels above 235 should be equally white:
In the above image the VideoScope graph shows the luma channel before conversion to RGB. The test pattern shows what VirtualDub does when converting YUV to RGB. You can use a pattern like this to adjust your monitor and check your workflow.
The same DV AVI file opened with AviSource() and converted to RGB with ConvertToRGB(interlaced=true, matrix="PC.601"):
The video is not supposed to look like this on TV. But if your AVI file has details in the super-blacks and super-whites, and you want to bring out those details, you have to do it while the video is in YUV, or after converting to RGB with the PC.601 matrix.
In my experience, many DV camcorders record with black levels too high (no black below Y=32 or so) and with many brights above Y=235.
<edit> I noticed that the zero patch in the DV AVI file was 5, not zero. So I made a new AVI and uploaded it </edit>
Last edited by jagabo; 22nd Apr 2012 at 12:54.
Rarely does anyone shoot 100% perfectly without needing to make any adjustments or filtering
If you use cedocida , you can configure the output. Sometimes other DV decoders don't allow configuration e.g. ffdshow's DV decoder will only output YV12. As jagabo metioned, you can use vdub's file information on the native DV-AVI file to see the current DV VFW decoder
Okay, in VirtualDub, under file information, it says Decompressor is ffdshow. I always get overwhelmed in ffdshow. So I have the ffdshow video decoder configuration box open, but now I don't know where to look. Under codecs, I see DV listed under format, and the decoder is set to disabled. The drop down list gives me 2 choices: disabled and libavcodec. Should I be looking somewhere else?