Log in

View Full Version : Announcement: New open source DV codec (VfW)


Pages : 1 [2] 3 4 5

vlada
26th May 2006, 10:38
lq> How did you "install" the Cedocida DV codec?

Fizick
27th July 2006, 17:31
I try tyhis codec.
It is good, thanks.

But I have some comments:
I like to have YUY2 (not YV12) for decode toAvisynth. But when I use "force" option, and YUY2 switch,
I can not open any DV avi in VirtualdubMod (it accept RGB only).
So, in my opinion, we must have not radio buttons to decode option, but check boxes for enabled video formats (RGB, YUY2, YV12). In this case "force" option box can be omitted.
The same for encode options.
What anybody (and author) think about it?
I can try implement it myself, but I have some other programs to code :)

Fizick
8th August 2006, 18:10
More comments (I look to its source a little).

Cedocida DV decoder v0.1.6 always firstly produce raw YV12-DV frame.
If output format is YV12 DV, it directly output this frame.
If output format is not YV12-DV, Cedocida always convert this DV-frame to YUY2. (YUY2 is formed correctly, by averaging, and Reinterpolate420 is not needed).
If output format is YUY2, Cedocida output this YUY2.
If format is RGB, Cedocida converts this YUY2 frame
to RGB and output it. The last conversion is the same as Avisynth function ConverttoRGB().
If format is YV12, Cedocida convert this YUY2 frame to YV12 (interlaced or progressive)and output. The last conversion is the same as Avisynth function ConverttoYV12(interlaced=true or false).
So, output to YV12 produce exactly the same results as output to YUY2 with followed function ConverttoYV12(...).

It is possible to implement direct (one-step) conversion YV12-DV to YV12 normal (MPEG2), with appropriate pixel chroma interpolation . But I am not sure, that the difference will be visible.

henryho_hk
13th August 2006, 12:09
Does anyone know how to bring the configuration screen in one command line?

Fizick
13th August 2006, 20:32
configuration is stored in cedocida.ini file (windows folder). But in hex format.
You may try save and copy various versions of this file.

WorBry
15th August 2006, 08:13
Hi Fizick,

As you've probably noted, there's been some dialogue on this same issue in the 'DV Decoder Differences - Update' thread

http://forum.doom9.org/showthread.php?p=863039#post863039

Out of interest, if I configure Cedocida with forced output to YV12 (DV) and then apply ConvertToYV12(interlaced=true) what will be the YV12 subsample format of the output AVS stream i.e. is the YV12 (DV) subsample format retained or will ConverttoYV12 convert it to YV12 'normal' (MPEG2, interlaced) format? If the latter, then one assumes that conversion via a YUY2 intermediate is avoided, unless of course ConvertToYV12 does the same.

On that note, I wonder if anyone is aware of an AVS filter or ''analyzer'' that can reveal the YV12 sub-sample format of an AVS stream? 'Info' doesnt (afaik) provide this level of analysis.

henryho_hk
15th August 2006, 12:43
If Cedocida adopts simple linear interpolation, "DV 4:1:1/4:2:0 Interlaced" -> YUY2 -> "MPEG2 4:2:0 Interlaced" would be equivalent to direct "DV 4:1:1/4:2:0 Interlaced" -> "MPEG2 4:2:0 Interlaced", except for more rounding errors.

WorBry
15th August 2006, 15:59
Henry,

Thanks for your input but it does really answer the fundamental question:

If fed with YV12 (DV), what is the output from ConvertToYV12(interlaced=true). Is it:

a) YV12(DV) i.e. unchanged?
or
b) YV12 (MPEG2, interlaced) ?

If b), does ConvertYV12 make the conversion:

c) Directly, with no intermediate involved?
or
d) Via YUY2 or another intermediate that incurs an additional color space conversion step

Since I am not aware of a means of analyzing the YV12 sub-sample format of an AVS output stream, I cannot answer the question myself, hence my inquiry whether such an AVS filter or analyzer exists.

Cheers :)

henryho_hk
15th August 2006, 17:09
@WorBry, I was indeed not answering your questions. I was actually responding to Fizick. Let's move to other threads for discussions not directly related to Cedocida.

WorBry
15th August 2006, 19:37
Well you can do so if you like, but since my query quite clearly does relate directly to Cedocida and was specifically put to Fizick in response to his post above, which itself refers to ConvertToYV12, I think it is appropriately placed in this thread. If he or someone else with credible insight chooses to respond, then I will have learned something of value. If not, then it is only I who have wasted my time. I must apologize if my post has interrupted your own highly charged exchange of original ideas,:rolleyes:, but I dont see Moderator under your avitar. Thank-you.

Wilbert
15th August 2006, 19:50
If fed with YV12 (DV), what is the output from ConvertToYV12(interlaced=true)
If you open YV12 (DV) in AviSynth and use ConvertToYV12(interlaced=true) nothing will happens because the color format is the same (although the chroma positions are different). It becomes a problem if you convert to YUY2 *in* AviSynth, because in that case the wrong placement (that is the wrong coefficients) is used.

As for Fizick's comment:

I see Fizick has looked at the Cedocida source code and concluded that the conversion from YV12 (DV) to YV12 (MPEG2) actually proceeds via a YUY2 intermediate
That might be true (if Fizick checked the source i'm sure it's true). I know for sure that the chroma is correctly reinterpolated.

WorBry
15th August 2006, 20:02
Thank-you Wilbert. Now I've learned something.

Boulder
20th August 2006, 10:22
If output format is not YV12-DV, Cedocida always convert this DV-frame to YUY2. (YUY2 is formed correctly, by averaging, and Reinterpolate420 is not needed).
If output format is YUY2, Cedocida output this YUY2.
If we talk about PAL DV, should we use scharfis_brain's ReYV12 function to get the YV12 output or is the internal ConverttoYV12(interlaced=true) enough?

That is,
should we a) enable YV12 and MPEG2 interlaced output or b) enable YUY2 output and use ReYV12 in the script?

WorBry
20th August 2006, 13:24
I was wondering the same myself, but on checking the ReadMe for ReYV12 it states:

''reverts YUY2 decoded PAL-DV to its native DV-YV12''

I seem to recall some side note that the function was primarily created for re-conversion of processed YUY2 output from the Canopus decoder. Correct Scharfis?

Edit: there it is in the MVBob script notes:

#revert PAL-DV to YV12 for quality reasons; needs yuy2 input (ie. canopus-dv-decoder)

Presumably Cedocida carries out a similar routine to encode DV(YV12) from YUY2 input?

henryho_hk
21st August 2006, 06:44
Both ReYV12() and ConvertYV12(interlaced=true) are intended for field-based materials. ReYV12() uses point sampling and picks up the chroma information of even rows (row 0, 1, 2, 3....) of every _field_. For some DV codecs such as Canopus, the discarded chroma info. are simply duplicates. On the other hand, ConvertYV12(interlaced=true) generates the chroma pixels by interpolation according to the defined chroma sample positions in MPEG2/4 4:2:0 Interlaced.

I would say Cedocida's Interlaced MPEG2 YV12 output is appropriate for most purposes. Use ReYV12() when you need original chroma for some specific purposes.

Jumbie
15th October 2006, 07:17
Hi guys. Was previously using the Panasonic DV codec but thought I'd give this a try since I end up converting to YV12 in order for some of my filters to work in avisynth.

The thing is that I just tried a short 5-second test capture and when I tried convolution3d on it, an error spit out about how it "supports YV12 only".

How do I change the settings to make my clips get recorded in YV12? Is this possible to do even? My camera is a Sony DCR-PC330.

I've used vcswap.exe to access the configuration settings of Cedocida and checked "force input format" and selected YV12. That didn't seem to help so I did the same for "force output format".

Any help would be appreciated. Thanks.

WorBry
15th October 2006, 16:59
Jumbie,

Changing the Cedocida 'input' settings will not affect the outcome because they only influence the DV encoder component of the codec. Certainly, for final rendering to (non-DV) YV12 format (MPEG-4, MPEG-2 etc), "forced" YV12 output with "MPEG2 interlaced" sampling is recommended.

Can’t see why you're getting an error with Convolution3D-YV12 though. Are you sure you have uninstalled or inactivated the Panasonic codec or any other DV codec that could be over-riding Cedocida? Easy enough to do with VCSwap - just drag the codec entry from the active to the inactive window. By the same token, make sure Cedocida is ‘active’.

That’s the only thing I can think of.

Jumbie
15th October 2006, 17:22
Hi WorBry. Yeah, I'm pretty positive that I have uninstalled the Panasonic DV codec. I actually did that before finding VCSwap and, upon loading VCSwap, it does not show up.

Here is a screenshot of my currently installed codecs:

http://img121.imageshack.us/img121/1091/codecbu9.th.gif (http://img121.imageshack.us/my.php?image=codecbu9.gif)

And here is one with my current settings for Cedocida:

http://img165.imageshack.us/img165/4976/settingsqx4.th.gif (http://img165.imageshack.us/my.php?image=settingsqx4.gif)

I changed the YV12 chroma sampling to DV cause I figured that's what I'm recording in. I am actually recording straight to a hard drive with WinDV and not using any tapes. So should I change that to MPEG2 interlaced instead as my output will actually be MPEG-4 (using x264)?

What if I record in progressive mode (30p) as my camera has this ability? Does it matter then and should I perhaps change it to MPEG2 noninterlaced (if leaving it in DV is not correct)?

Dunno what's up with Convolution3D. I checked to make sure it was using the YV12 version and I am. Using converttoyv12() lets the script work.

Anyway, thanks for the reply and for clearing up what the "input" settings do. Sorry about all the questions but there's no documentation that I'm aware of and I'm not sure of the proper settings to use. Obviously...

WorBry
15th October 2006, 18:10
Well, there's your problem right there. If those are the decoder setiings you're using, then you are outputting (default) YUY2.

Tick the 'Force Output Format' box, select YV12* and, under *YV12 Chroma Sampling, select MPEG-2 Interlaced.

I think the 30fps progessive option you are referring to must be the 'Movie Ex' mode for recording short (jittery) MPEG-1 clips to Memory Stick. Would you really want to use that when you've got DV?

Jumbie
15th October 2006, 18:16
Well, there's your problem right there. If those are the decoder setiings you're using, then you are outputting (default) YUY2.

Ooops, I had changed the settings back to default. I believe I had YV12 selected before. I'll try again later when I get the chance. Not home at the moment.

Tick the 'Force Output Format' box, select YV12* and, under *YV12 Chroma Sampling, select MPEG-2 Interlaced.
Will do.

I think the 30fps progessive option you are referring to must be the MPEG-1 ('Movie Ex') mode for recording short (jittery) clips to Memory Stick. Would you really want to use that when you've got DV?

I don't think that's the case. While my camera can indeed record to the memory stick and produce low-quality clips, the manual says this about the progressive mode:

This feature is useful for movies you intend to import to your computer to produce still images.
You can record pictures with less blurring than recording in normal mode, producing pictures suitable for analyzing high-speed action such as sports. To enjoy a movie, it is better to record the picture in normal mode, since the image is recorded only evern 1/30 of a second in the progressive recording mode.

Note on the progressive recording mode
In a normal TV broadcast, the screen is divided into 2 finer fields and these are displayed in turn, every 1/60 of a second. This, the actual picture displayed in an instant covers only half of the apparent picture area. In progressive recording, the picture is fully displayed with all the pixels. A picture recorded in this mode appears clearer, but a moving subject may appear awkward.

Anyway, like I said, I'll try again later and see if changing the settings to force YV12 in output will sort my problems out.

Thanks again.

Jumbie
15th October 2006, 18:58
I think I figured it out. I was using DirectShowSource to load my clip instead of AviSource.

When I do an info() command after DirectShow it lists the colourspace as YUY2 but it shows it as YV12 after AviSource. So that's why Convolution3D wasn't working. If I use AviSource, it does. :)

WorBry
15th October 2006, 19:25
Well there you go. Still dont understand this 'progressive' mode though. Cant be DV (which is interlaced) and you say it's not MPEG-1. So what is the format?

Also, I'm a bit perplexed that the Cedocida 1.6 dll appears with 3 FourCC entries on your VCSwap screen shot (YV12, dvsd and YUY2), whereas I only see dvsd in mine. Can anyone explain that?

Jumbie
15th October 2006, 19:29
Cant be DV (which is interlaced) and you say it's not MPEG-1. So what is the format?

Does DV have to be interlaced by definition? Haven't had the camera long but thought it was just a "progressive DV" format just going 30p instead of 60i.

Also, I'm a bit perplexed that the Cedocida 1.6 dll appears with 3 FourCC entries on your VCSwap screen shot (YV12, dvsd and YUY2), whereas I only see dvsd in mine. Can anyone explain that?

Right click on it and select "Scan Codec for FOURCCs" that's what I did and then activated them.

JohnnyMalaria
15th October 2006, 21:43
Does DV have to be interlaced by definition? Haven't had the camera long but thought it was just a "progressive DV" format just going 30p instead of 60i.

No, it doesn't.

The DV specification supports both progressive and interlaced (IEC 61834-4, page 122). The way in which the video frame is compressed is identical, though. e.g., for NTSC, it doesn't matter whether the 720x480 frame is progressive or interlaced - the information is encoded the same way. The DV data stream contains a variety of flags, including progressive vs interlaced. This is really to tell the video hardware how to regenerate the video signal correctly.

WorBry
15th October 2006, 22:30
By Jolly-Wingo, you're right. Just encoded a pure 576p25 avi source to DV (Cedocida) and it's lo and behold, its progressive. And there was me thinking all this time that DV has to be interlaced

bb
16th October 2006, 06:22
Many people say DV is interlaced, but this is plain wrong. This prejudice probably comes from the fact that most DV camcorders don't have a progressive scan option. Jumbie's camcorder is obviously one of the rare models that support progressive video (mine does, too).

Regarding compression, DV can support interlaced video by using different sizes of macroblocks; besides the standard 8x8 there's the combination of two 4x8 blocks as well ("2-4-8-DCT mode"). And there's the adaptive interfield compression, which treats interlaced frames as progressive frames, if the encoder detects little difference between the two interlaced fields.

The DV specs require the video stream to be compressed in frames, not in fields. This is contrary to MJPEG, where most codecs compress interlaced video on a field basis. Thus I am tempted to say that DV is more a progressive format with an interlaced support addon rather than an interlaced format.

bb

JohnnyMalaria
16th October 2006, 11:35
Regarding compression, DV can support interlaced video by using different sizes of macroblocks; besides the standard 8x8 there's the combination of two 4x8 blocks as well ("2-4-8-DCT mode"). And there's the adaptive interfield compression, which treats interlaced frames as progressive frames, if the encoder detects little difference between the two interlaced fields.

The 2-4-8 DCT mode *is* the adaptive interfield compression....(but it isn't compulsory).

zambelli
28th October 2006, 10:12
Just curious: have there been any tests done of the Cedocida ENcoder in terms of generational quality loss? How does it compare to MainConcept, Canopus or Panasonic? Is it safe to use it for DV editing projects?

zambelli
5th November 2006, 14:49
Just curious: have there been any tests done of the Cedocida ENcoder in terms of generational quality loss? How does it compare to MainConcept, Canopus or Panasonic? Is it safe to use it for DV editing projects?
OK, I can't seem to get PAL 4:2:0 DV encoding to work. Whenever I try to recompress a YV12 Avisynth output to PAL DV with MPEG-2 interlaced input option enabled - the resulting stream has strange flashes, macroblocks and errors. Has anybody been successful in encoding PAL DV with Cedocida?

Ngr
5th November 2006, 18:04
I, too had the same problem last week that i tried using it as an alternative to huff. Decoding had no problem.

zambelli
5th November 2006, 22:56
I, too had the same problem last week that i tried using it as an alternative to huff. Decoding had no problem.
I tried YUY2 input too to see if it made a difference. It didn't. Is PAL DV encoding entirely broken?

WorBry
6th November 2006, 06:06
I had a similar problem encoding a YUY2 (HuffYuv) source to DV with Cedocida, but only in 'High' quality mode. The main aberration was a (seemingly) random lag in block sets from frame to frame. In 'normal' mode it came out OK.

zambelli
6th November 2006, 10:55
I had a similar problem encoding a YUY2 (HuffYuv) source to DV with Cedocida, but only in 'High' quality mode. The main aberration was a (seemingly) random lag in block sets from frame to frame. In 'normal' mode it came out OK.
Sounds like there's still some work to be done on Cedocida, at least on the encoder side. Is anyone actively working on its development? I get the feeling there are a ton of people working on, say, x264, but nobody on the only free DV codec - which would certainly be just as useful, if not more.

Anyway, this bug poses an interesting problem: How do I take a DV video, decode it in Avisynth with Cedocida (to take advantage of its 4:2:0 YV12 output), do some necessary filtering, and then re-encode it to DV again with a tested DV codec such as MainConcept? Is there any way to make the two codecs co-exist at the same time?

Obviously, one solution is to output to an intermediate lossless codec such as HuffYUV, and then switch DV codecs and encode to MainConcept - but I'd much rather do it without that middle step if possible.

bb
6th November 2006, 14:36
You'd have to register one of the two codecs to use a different four cc - but don't as me how to do that :) (maybe your friends at Microsoft can help you out?).
You may try Cedocida together with the Canopus codec, because Canopus has always used a different four cc that the rest of the world.

bb

zambelli
7th November 2006, 00:24
You'd have to register one of the two codecs to use a different four cc - but don't as me how to do that :) (maybe your friends at Microsoft can help you out?).

Yep, I ended up doing exactly that. I modified the Cedocida.inf installer to install MainConcept under a different FourCC. It seems to have worked. I use the AVI FourCC changer utility to switch the FourCC back to 'DVSD' afterwards. I'll post the .inf as soon as I verify it's definitely working correctly.

zambelli
7th November 2006, 07:01
Yep, I ended up doing exactly that. I modified the Cedocida.inf installer to install MainConcept under a different FourCC. It seems to have worked. I use the AVI FourCC changer utility to switch the FourCC back to 'DVSD' afterwards. I'll post the .inf as soon as I verify it's definitely working correctly.
OK, rather than posting a full .inf file, I'll just post the registry keys that need to be set in order to install another DV codec under a different FourCC. If you prefer to have an .inf installer, just take Cedocida.inf and modify it.


Windows Registry Editor Version 5.0

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MediaResources\icm\vidc.dvmc]
"Description"="MainConcept DV Codec"
"Driver"="mcdvd_32.dll"
"FriendlyName"="MainConcept DV Codec"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\drivers.desc]
"mcdvd_32.dll"="MainConcept DV Codec"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
"vidc.dvmc"="mcdvd_32.dll"


In this example MainConcept DV (mcdvd_32.dll) is installed to handle FourCC 'DVMC'.

After encoding, you can use the AVI FourCC Changer (http://www.inmatrix.com/files/avic_download.shtml)utility to change the 4cc back to 'DVSD'.

zambelli
7th November 2006, 07:02
@Moderator:

Would it be possible to split this thread into a new Cedocida discussion thread? I think the existing thread is getting low visibility as a sticky.

cedocida
7th November 2006, 10:48
I've read your reports about an encoding bug and can reproduce it using the quality mode "high".
I will investigate and try to fix it.
If there are other bugs not mentioned yet, please tell me.

Regards, Andreas

zambelli
8th November 2006, 12:21
I've read your reports about an encoding bug and can reproduce it using the quality mode "high".
I will investigate and try to fix it.
If there are other bugs not mentioned yet, please tell me.

Thanks, Andreas. This is the only one I have found so far.

Fizick
9th November 2006, 20:57
A. Dittrich,
Other suggestion: may be it will be beter to use checkboxes for enabled video formats instead of radiobuttons with single out format.
(really, I created this code modfication for myself and can provide a sources :) )
I prefer to use YUY2 and RGB switched ON.

IanB
13th November 2006, 00:54
Minor point! The configure dialog box is in English but the Cancel button is labeled in German i.e. "Abbrechen"

zambelli
13th November 2006, 09:06
Just curious: has anyone done any tests of DV encoder quality here? There's been a lot of talk (as shown in the stickies) about decoder quality, but seems like encoder quality has been largely ignored.

I'm thinking it should be fairly simple to do a DV encoder test. We take a short sample, say 150 frames in length, of both PAL and NTSC type, of both interlaced and progressive type, and we host it somewhere in its native DV form. Then everybody takes their favorite DV codec and re-compresses the source clip, then runs PSNR and SSIM comparison against the source using Avisynth. Because DV is intraframe compression only and the bitrate is constant (25 Mbps), it should be easy to find the best DV encoder by simply comparing PSNR/SSIM scores. Does that sound like a good idea?

Fizick
13th November 2006, 22:01
zambelli,
not in this thread

zambelli
14th November 2006, 01:58
zambelli,
not in this thread
Agreed. I'll compile some sources for the test and I'll start a new thread.

zambelli
15th November 2006, 18:39
I've read your reports about an encoding bug and can reproduce it using the quality mode "high".
I will investigate and try to fix it.
If there are other bugs not mentioned yet, please tell me.

Hi Andreas,
There is a problem in the normal quality encoder too. I noticed it when doing a 90-minute PAL encode. The first hour encoded great, and then suddenly the strange violet-gray blocks started popping up randomly. It's probably the same bug as in the High Quality mode, but just less obvious.

Serbianboss
19th November 2006, 16:38
I found very interesting problem about cedocida dv codec.

If in decoder option select: force output format and chose yuy2 we cannot load dv avi file in virtual dub or cce.

But if we make simple avisynth script:

AVISource("C:\Documents and Settings\Desktop\some movie.avi")


We can load dv avi in virtual dub and cce.

So, we cannont load dv avi file,but we can load if we make simple avisynth script.

What can be this?

Fizick
19th November 2006, 17:28
Serbianboss,
Currently you must select rgb to work with virualdub.
that is why I suggest to change radiobutton to checkboxes with many enabled options (yuy2 and rgb).

Serbianboss
19th November 2006, 23:31
One question for YV12 in cedocida codec.

IF we want YV12 from cedocida does is better to stay all at default(no select force output format,be default its select yuy2 but its yv12 for pal) or we must select output format and chose yv12.

I mean what is differences in both case i got yv12.

IanB
20th November 2006, 01:57
It is not the codec that chooses the output format. It is the application you are using. This is why there is an option to limit the acceptable formats to 1 only. This is so you can know that it is exactly using the format you want and expect. Everything else fails, so you can then itterate and correct the issue.

AviSynth's AviSource always tries YV12, then YUY2, then RGB32, then finally RGB24, unless of course, you force the Pixel_Type.

Other application have other priorities and needs, so do things in different ways. E.g. VirtualDub prefers RGB32 normally but in fast recompress mode prefers YUY2.

So unless you have a reason to force a format leave it in the default mode and let your application do what it knows best.

Serbianboss
20th November 2006, 09:41
I force because CCE like YUY2. And i can got only if i forced yuy2. Be default(when not selected force option) i get YV12 which is good for virtual dub but not for cce. I mostly use avisynth filters which want YUY2 not yv12.

So, me goal is to get yuy2.That's i asked what is difference if i select force output and chose yuy2 or if i chose yv12. In both case i got yuy2.