Sony DV Codec DeCompressor Request

AudioIvan wrote on 9/30/2004, 3:00 AM
As you may know, Vegas DV-AVI quality comes from the Sony DV Codec.
However, it is just compressor !!!
For propper AVIsynth filtering or VDub filtering compressed video should be decompressed.
I do understand that Sony's codec is hidden, but there are so may cases where bad chroma upsampling or bad DV decoding is happening because of the fourcc dvsd codecs.
If the video is decompressed with the same codec that produced the video, there are no problems.
So for us AVIsynth/Vdub addicts Sony DV Codec(in full compressing/decompressing capabilities) is a MUST !!!
MainConcept codec ships in full version but it's NOT decoding Sony's DV-AVI's propperly.

AudioIvan

Comments

John_Cline wrote on 9/30/2004, 5:59 AM
I agree, it would be nice if Sony made their DV codec available as a VFW compatible codec.

What kind of problems are you seeing with MainConcept's DV codec when decompressing Sony DV-AVI's?

John
AudioIvan wrote on 9/30/2004, 7:49 AM
Mostly interlacing artifacts, PAL DV-AVI jagginess, discoloration
You can see the difference in compression and decompression with hyffyuv,
render small clip in Vegas using hyffyuv codec, and play it with Media Player Classic,
you'll see that hyffyuv is the decompressor.
If you have MainConcept DV codec instaled on your PC you'll see also this:
render clip in Vegas using Sony DV codec, now right click on the avi file,properties,summary and you'll see that default codec/in this case just decompressor is MCDVD_32.DLL.
Now open the avi file in VDub/Mod, file information should show fourcc code Sony Pictures DV and decompressor Main Concept DV codec v2.4.4
I've used Canopus DV codec, Main Concept, hyffyuv, PicVideo but Sony DV Codec gives the BEST quality.
Shame that we can't use it with full potential.

AudioIvan
John_Cline wrote on 9/30/2004, 8:36 AM
The MainConcept DV codec does have a settings dialog box which can be accessed from the Virtual Dub video compression section. The MC codec defaults to "fastest" for the compressor and "preview quality" on the decompressor, both of which are not optimal quality. You might want to check and make sure you have deselected everything in the MC DV settings section. I've never had a problem with the MC-DV codec in VirtualDub.

John
johnmeyer wrote on 9/30/2004, 9:21 AM
I too use the MC DV codec in VD. I used to swear it was the best I'd ever seen, until I encountered the Sony/SoFo codec, which of course is close to perfection.

I have occasionally been disappointed with the MC DV results, but in retrospect it may have been a 16-235 issue. I do a lot of work with AVISynth as well as VD, and do a lot of frameserving (which, BTW, is often a way around having to use the MC DV codec) and often I forget which colorspace I am working in, and forget that you can get into issues where one program assumes 0-255 and the other is supplying video truncated to 16-235.

Back to your problem. John_Cline has already made the suggestion I would have made, namely to make sure you are not using the MC DV default ("fast"), which WILL produce inferior results. However, in addition, if you can tell us what your workflow is, perhaps I can suggest a way to avoid the encoding altogether. Using the Wax plug-in, you can serve into Vegas, and another Satish gem, the frameserver plug-in, you can serve out from Vegas. In the past few months, I have almost completely eliminated using the MC DV codec.

Last night, for instance, I brought some VHS captures into Vegas. I did some cuts and color corrections, title overlays, etc. Nothing fancy. I then frameserved this from Vegas. I then used VirtualDub to open an AVISynth script that does chroma cleaning (an absolutely necessity for VHS) as well as light temporal cleaning (there are some amazing, new plug-ins for AVISynth). This AVISynth gets its input from the Vegas frameserver. The only reason to us VD is to provide a way to then frameserve the output of the AVISynth script into the MainConcept MPEG-2 encoder. Thus, the workflow is:

Vegas -> Satish Framerver -> AVISynth script -> VirtualDub -> VD frameserver -> MainConcept MPEG-2 standalone encoder.

Thus, there is no intermediate encoder. What's even more amazing, even with some fairly high quality settings in the MC MPEG-2 encoder (which slow things down), the AVISynth plug-ins are so fast (especially compared with their VD counterparts) and there is so little overhead in the two frameservers, that this whole chain encodes at close to 1.5x real time. In other words, it is pretty darn fast, considering that I am doing chroma cleaning, temporal smoothing, etc.

If you want more details, let me know and I'll email them to you, or simply post them here.
AudioIvan wrote on 9/30/2004, 8:04 PM
Yeah, I like your workflow but I preffer to do it in this way:
VHS capture digitize with DV Cam, capture with Vegas(so I can take advantage of the Sony DV codec),do edit, transitions,whatever in Vegas,render to PAL DV-AVI(Sony DV codec).
Now I have pure Sony DV-AVI in YUY2(most of the AVIsynth filters work in YUY2 or YV12).
Here is the problem: if Sony DV codec included in Vegas has decompressor I'm fine, but that is NOT the case.Because Vegas/Sony DV codec is just compressor, I have to use DirectShowSource()/in my case hyffyuv is decompressing the DV-AVI providing I use DirectShowSource().
I now have just hyffyuv instaled on my system.Obviously AVIsource() returns "could not find decompressor for fourcc dvsd" which once again proves that the Sony DV codec incl. in Vegas is just compressor!
IMHO I'd rather use hyffyuv to decompress Sony DV than Main Concept DV codec.
Back to the workflow,
so
DirectShowSource()
ConvertToYV12(interlaced=true)
Cnr2()default settings work just fine/no need for adjustments
SeparateFields()
SpatialFiltering(your favorite filter goes here)
Temporal/SoftFiltering(your favorite filter goes here)
Interleave(evn,odd)
Weave()
Crop,Trim,Resize if needed
ConvertToYUY2(interlaced=true)
ColorYUV(levels"PC->TV")

Then just import the script in your favorite encoder/in my case for DV-AVI Canopus ProCoder and you're done.
What I'm asking is:
We need Sony decompressor so we can do whatever we want,providing that we are NOT changing AVI comp/decompressors, thus NOT changing/altering colorspaces,decoding issues...

This is just one example of how is done with Canopus DV codec:
Say you've got AVI and you want to do some filtering
Make the script and import it in ProCoder,render to Canopus (reference) DV-AVI
Now play the DV-AVI with Media Player Classic and you'll see that the default decompressor used is Canopus DeCompressor.
AND THAT'S WHAT I'M TALKING ABOUT
That is what we need from Sony DV Codec.

I know there are some very good AVIsynth filters, but the most important thing is that you must know how and when to use them.
My favorites are Dust(pixie),Deen,Conv3D,STmedian,UnDot,Cnr2,Vague,MipSmooth,DeSpot,DeGrainMedian....
Realy depends on the source.

AudioIvan


AudioIvan wrote on 9/30/2004, 8:07 PM
Oh, I'm totaly aware about the "default"settings in Main Concept .
I don't use it anymore, no need for it.

AudioIvan
John_Cline wrote on 9/30/2004, 9:16 PM
AudioIvan

When you capture DV video via Firewire, the video has already been compressed to DV using the hardware DV codec in the camcorder. There is no codec involved when capturing from the camcorder, in essence it is a straight file copy operation from the DV tape to the hard drive. The Sony DV codec is NOT involved when capturing with Vegas. It is used by Vegas when you export video from the Vegas timeline, but ONLY if the video has been modified in some way, like transitions, filters or added titles. If you do a "cuts only" edit, Vegas will just copy the video in its original form to the new file. Even though the video has been edited, it has not been decompressed and recompressed in the process.

Secondly, Huffyuv can not and does not "decompress" DV format .AVI files. If you are using DirectShow as your decompressor in AviSynth , then it is certainly using the Microsoft DirectShow DV codec, which is generally considered the worst looking codec of the bunch.

Now, if you want to make absolutely certain that you use the Sony DV codec for both decoding and encoding, then capture with whatever DV capture utility you'd like, do what you need in Vegas (it will use the Sony DV codec for decoding) and then render as a Huffyuv .AVI file, apply whatever processing you need in AVIsynth and render the AVIsynth output to another Huffyuv file, bring that back into Vegas and render it as a DV file. The Sony DV codec will be used throught the process whenever DV video needs to be decoded or encoded.

John
AudioIvan wrote on 9/30/2004, 9:43 PM
That explains a little.
"capture with Vegas(so I can take advantage of the Sony DV codec),do edit, transitions,whatever in Vegas,render to PAL DV-AVI(Sony DV codec)."-->means of course take advantage of the Sony DV codec AFTER capture.

However, what I would like to see is an option in Vegas for capturing like the one in the MC encoder,meaning you can choose compression for the capture.
So, after capture with Vegas,render as PAL DV-AVI using Sony DV codec is useless for me because I simply can't do any AVIsynth processing unles I render to hyffyuv in Vegas(which I don't like but I have to in order to do AVIsynth processing).
Using Sony DV Codec all the way is the best option for me, however that is NOT possible with Vegas and AVIsynth.
I guess they keep the codec in "top secret" folder.

AudioIvan
musicvid10 wrote on 9/30/2004, 10:15 PM
Sorry in advance if I missed something in your discussion, but wouldn't frameserving from Vegas to AVIsynth solve your decompressor problem?
John_Cline wrote on 9/30/2004, 10:16 PM
Using Sony DV Codec all the way is the best option for me, however that is NOT possible with Vegas and AVIsynth.

In essence, it IS possible. I just explained how to do it. Huffyuv is a lossless codec, so if you need to process video outside of Vegas, as far as image quality is concerned, you would be using the Sony Vegas DV codec for all operations where a DV codec would be involved. Also, as musicvid, pointed out, frameserving is another option.

John
AudioIvan wrote on 9/30/2004, 10:41 PM
Well it is NOT possible.
Frameserving from Vegas is NOT an option, because that would be:
Satish Frameserver-->AVIsynth(Frameserver/filtering)-->Encoder.
That is very CPU intensive task and sloooow.
Hyffyuv IS losless codec , but is NOT like Sony DV Codec!!!

taliesin wrote on 9/30/2004, 10:47 PM
>> Hyffyuv IS losless codec , but is NOT like Sony DV Codec!!!

Well, talking about qualitiy HuffYUY is even better. You needn't Sony DV codec for decoding because - like John posted before - Sony DV wasn't involved before if you didn't do a real rendering in Vegas.
Sure MS-DV is kind of worst choice. So I suggest using the Matrox DV codec which is similar in quality as Sony DV (but take care to have the codec settings well adjusted for Matrox DV).

Using the frameserver saves the time of a render process so it is not actually slow.

Marco
johnmeyer wrote on 10/1/2004, 12:01 AM
Frameserving from Vegas is NOT an option, because that would be:

Gee, that sure hasn't been my experience. As I posted above, I am doing pretty much what you describe above, as follows:

Satish Framerver -> AVISynth script -> Encoder

My AVISynth script is as follows:

#Serve RGB32 from Vegas. If going into Mainconcept MPEG encoder,
#convert back to RGB32 in this script. Check the RGB 16-235 box in the Mainconcept encoder.

# CNR2 does NOT need to be fed deinterlaced frames
# nor does fluxsmooth.
loadPlugin("c:\Program Files\AviSynth 2.5\plugins\Cnr2.dll")

AVISource("D:\Frameserver.avi")

#These plugins require color space conversion
converttoYV12(interlaced=true)
Cnr2("oxx",8,16,191,100,255,32,255,false)
fluxsmoothT(7)
ConvertToRGB32(interlaced=true)
The whole shebang, including the two filters, two frameservers, and MPEG-2 encoding (using some fairly slow settings in the external MainConcept encoder), takes place at about 1.4x real time (i.e., 14 minutes to finish 10 minutes of video). To me, at least, that seems pretty fast.

BTW, the new FluxsmoothT (which is speed-optimized for temporal smoothing) is really excellent.
AudioIvan wrote on 10/1/2004, 12:19 AM
The speed depends on the filters, optimized filters like conv3d,flux,deen,stmedian are very fast.

Read this:

"1. PeachSmoother + VagueDenoiser (or MipSmoother) is a nice combo where user will try to achieve best of both worlds; excellent denoising of still scenes of Peach, and smoothing out the ghosting artefacts on hi-motion levels. But it won't make wonders, Pixie will probably work slightly better on motion. Note that Peach's algorithm tries to leave elements that are important for sharpness (edges etc.) intact. You will notice that Peach leaves those vertical lines of vhs pretty noisy and shimmering.

2. Pixie has best quality on motion. We recommend this where Peach would normally ghost too much (higher motion/noise levels; in music videos etc), and you have a lot of time to do your encodings. The main issue is that Pixie is VERY slow (it's probably doing 2 passes internally), and it looks slightly blurrier than Peach.

3. Peach has best quality/speed ratio overall. We recommend this filter for long clips (like movies/tv-series), in case the combo's are too slow.

4. Overlay can be used for short (and difficult to denoise) clips if captures of different broadcastings (of the same clip) are available (like music clips).

5. Best filter is usually the slowest one (Murphy's Law).

Temporal denoisers will tend to ghost on medium / high motion scenes.
PixieDust works quite well in that regard. It also ghosts (better to say, leaves some noise on motion) to some extent, but less than other temporal denoisers. Its motion estimation algorithm is therefore not perfect, and it tries to cover it with more of spatial processing (blurring).

The ultimate combo would be VagueDenoiser/MipSmoother (spatial part) and PeachSmoother (temporal part).
PixieDust has the strongest performance with regards to ghosting/detail preserved. It has least ghosting while preserving a reasonable amount of details."

From Wilbert and Ivo's denoising tests.

AudioIvan wrote on 10/1/2004, 3:12 AM
Here is some info about the Matrox DV soft/hardware codec:
http://www.jayandwanda.com/DigitalSampling.html

AudioIvan
John_Cline wrote on 10/1/2004, 6:45 AM
AudioIvan,

Just making sure... do you understand the difference between a lossless codec like Huffyuv and a lossy codec like the Sony DV codec?

The only "loss" in the Huffyuv codec is an extremely slight rounding error in the YUV <> RGB conversion. It is not possible to do completely mathematically accurate YUV <> RGB conversions. Nevertheless, for all practical purposes, Huffyuv is lossless. Much more so than any DV codec.

John
taliesin wrote on 10/1/2004, 7:11 AM
Thanks for that link. What it shows are the 4:1:1 artifacts compared to 4:4:4 and 4:2:2 color sampling. This page is no good to compare different dv codecs. Sony DV looks the same. HuffYUV looks like the first example shown there.
I made an intensive dv codec test in the past using 10 render generations there. Matrox DV was similar in quality as Sony Pictures DV and Canopus DV, speaking about render artifacts.

Looking at the color sampling artifacts all dv codecs are same. The only difference here is between NTSC and PAL signals, where NTSC uses 4:1:1 sampling and PAL uses 4:2:0 sampling. But - as I said before - this is not really bound to the codec itself.

Marco
AudioIvan wrote on 10/1/2004, 8:18 AM
@john,
sure, I've been using hyffyuv since early days before the codec was even optimized by sh0dan.
The only reason why I'm in love with Sony DV codec is coz the file size and looks very close to hyffyuv(at least in my eyes).
Obviously, if I'm posting such questions about codecs I DO UNDERSTAND something, so there is no need for you to ask me such questions.

@taliesin ,
no probs, yeah hyffyuv looks like the first example, I agree.

AudioIvan
johnmeyer wrote on 10/1/2004, 8:26 AM
Obviously, if I'm posting such questions about codecs I DO UNDERSTAND something, so there is no need for you to ask me such questions

Well, as Steve Martin would have said, Excuuuse ME for trying to help. Gee wiz.
AudioIvan wrote on 10/1/2004, 8:53 AM
That reply wasn't for you johnmeyer.
Sorry for missunderstanding.
John_Cline wrote on 10/1/2004, 10:01 AM
AudioIvan,

I didn't mean to insult you, but because of some of your previous posts, it seemed that you may have been a bit confused. For example, you said that you were using the Huffyuv codec to decode DV video. This simply isn't possible.

There are only two instances where a DV codec should come into play in your workflow. First, in Vegas when applying transitions, filters or titles, the codec is used to decode the DV video. If you render the result to a Huffyuv file, then only one DV to YUV conversion has taken place and it is essentially lossless. If you do all of your subsequent processing on the Huffyuv file and render it as a Huffyuv file, then no loss takes place. You can decode, process and encode Huffyuv all day long with virtually no loss other than incredibly minor rounding errors. Then, as the final step in the process, pull the Huffyuv file into Vegas and render it using the Sony DV codec. There are only two instances where a DV conversion of any kind has taken place and both of them were handled by the Sony DV codec. Isn't this what you want?

DV uses a 5:1 lossy compression scheme, not to mention that DV has 1/4 of the chroma resolution compared to the luminance resolution, Huffyuv is, for all practical purposes, lossless and achieves its small amount of filesize reduction compared to fully uncompressed video because of the efficiency of storing YUV data as opposed to RGB data.

Decoding the DV video once to a lossless format like YUV or uncopmpressed RGB for subsequent processing and then encoding back to DV as the last step is vastly preferable to decoding/encoding in DV format at every step.

John
AudioIvan wrote on 10/1/2004, 10:25 AM
No probs john, at first I got a bit confused about using Sony DV codec but now it's all clear.
About huffyuv I totaly agree with you.Also my favorite encoder for DV is ProCoder 2.
CCE today released new version 2.70 with lots of GUI changes.
Anyway, the best workflow for me would be:
Vegas capture-->Edit,transitions,-->SatishFrameserver-->AVIsynth processing-->ProCoder2-->PAL DVD compliant bff MPEG 2 interlaced file-->my happy face-->my wife's angry face because I spend too much time on the PC.

cheers dude
John_Cline wrote on 10/1/2004, 10:38 AM
ProCoder 2 is also my favorite general encoder. It's MPEG2 output is excellent, too.

John
AudioIvan wrote on 10/1/2004, 10:56 AM
john, do you do any progressive video and if yes what is your impression on ProCoder 2 for progressive sources.
I find CCE much better for progressive.
Do you use AVIsynth?
I'm long time user and IMO is the best pre/post processing utilliy.

AudioIvan