PDA

View Full Version : Help, avisource fourcc has 'permanently' fixed my default codec


kevinm
2nd September 2005, 16:37
Last night I read in the AVISynth manual about the relatively recent addition of a 'fourcc' option to avisource. I was curious to test it to see if I could get it to use a different codec to decode my DV AVI, this is when my problem started ...


First I thought I would try to force the fourcc for the codec which I thought I had been using previously by default ..

AviSource("cap.avi", false, fourCC="DVSD")

Then I get the following error ..

AVISource: couldn't locate a decompressor for fourcc DVSD



So, I tried using a regular avisource (without the fourcc option) ..

AviSource("cap.avi")

BUT still I get the same error => it seems that avisource has permanently changed my default codec! .. is this the correct behaviour?


Unfortunately I don't know which codec I was using originally, in the past I have installed various codecs and I thought the last one I installed was the Panasonic one, however ..


Before I did 'avisource .. fourcc=DVSD', my encode script was able to load the clip and do a Reinterpolate411 without needing to do a conversion to YUY2 first, therefore I assume the codec output must have been YUY2 (or at least not RGB)


Since I couldn't remember how to enable a particular codec as the 'default' on I decided to simply reinstall the Panasonic one, now I can load the clip but when I do the Reinterpolate411 it fails, complaining that the clip is in RGB and needs to be YUY2, etc.


So from this I conclude the following:

1. 'avisource .. fourcc=xxx' 'permanently' changes the default codec
2. the codec I am now using (Panasonic) is NOT the one I was using originally

I am going to try to get hold of the Mainconcept codec (decoder only) as I believe this outputs YUY2 and may be what my system was set up for originally. Problem is that I think the Mainconcept codec is 'trialware' and time limited.

If anyone knows how to set up a particular codec to be the default one please let me know, I am sure there was some app I used in the past to do this but I can't recall what it is. I have used gspot, videoinspector and mediainfo and can see what codecs I have on my system but can't figure out how to enable a particular codec. I will also try to find out the fourcc code in the avctual AVI source, I have read that there is some app which can tell me this,

thanks,

Kevin

Wilbert
2nd September 2005, 16:46
1. 'avisource .. fourcc=xxx' 'permanently' changes the default codec
No, it doesn't. I can't write in your registry. Apperently something else happened.

2. the codec I am now using (Panasonic) is NOT the one I was using originally
Agreed.

If anyone knows how to set up a particular codec to be the default one please let me know
I don't think that's possible. The problem is that all VfW codecs (except Canopus) uses the same fourCC "dvsd". This implies that the last installed DV codec will be used as default.

Are you sure that you didn't use DirectShowSource to load your DV AVI?

Btw, why don't you install Cedocida DV codec. Works great!

kevinm
2nd September 2005, 17:18
Hi Wilbert,

"No, it doesn't. I can't write in your registry. Apperently something else happened" ..

No I wouldn't expect you to write to my registry, but somehow executing that avisource command screwed up my environment. Maybe though it is not AVS, perhaps somehow it changed the environment in TMGEnc? (which I am frameserving to).

I will try Cedocida DV codec, I have not heard of it before, does it output in YUY2? Do you know if I have to do the Reinterpolate411 thing when using this codec?

BTW I tried using your AVIInfo, v0.3 but it doesn't seem to work ..

clip.AVIInfo(fourCC,1)

returns ..

"I dont know what "fourcc" means"


Kevin

trolltuning
2nd September 2005, 17:18
No, it doesn't. I can't write in your registry. Apperently something else happened.


Agreed.


I don't think that's possible. The problem is that all VfW codecs (except Canopus) uses the same fourCC "dvsd". This implies that the last installed DV codec will be used as default.

Are you sure that you didn't use DirectShowSource to load your DV AVI?

Btw, why don't you install Cedocida DV codec. Works great!
Couldn't he just find the other DV codecs and unregister them with regsvr32 /u ?

kevinm
2nd September 2005, 17:20
it's ok, I just found the home page for that codec, I see that I can fource the output format - cool!

http://www-user.rhrk.uni-kl.de/~dittrich/cedocida/


Kevin

Guest
2nd September 2005, 17:42
The executable is here for those who can't build it:

http://www.neuron2.net/misc/cedocida016.zip

Wilbert
2nd September 2005, 18:12
"No, it doesn't. I can't write in your registry. Apperently something else happened" ..
C'mon that was a spelling mistake :) I meant "it" as in AviSynth.

BTW I tried using your AVIInfo, v0.3 but it doesn't seem to work ..

clip.AVIInfo(fourCC,1)
Try

clip.AVIInfo("fourCC",1)

kevinm
2nd September 2005, 18:36
AVIInfo still wont work, using the syntax you just gave me I get ..

"Script error: Invalid arguments to function "AVIInfo""

could it be a compatibility problem with the 2.5.6 Beta version I am using?

Anyway, not to worry, I am sure there is some other app I can use to query the fourcc code of my AVI.

Tonight I will have a play with that new codec, if I have problems I will try usng regsvr32 to register/unregister to get the one I want (5hanks for the reminder trolltuning)

Kevin

Guest
2nd September 2005, 18:45
AviSource("cap.avi").AVIInfo("fourCC",1)

or

AviSource("cap.avi")
AVIInfo("fourCC",1)

or

vid=AviSource("cap.avi")
vid.AVIInfo("fourCC",1)

or

vid=AviSource("cap.avi")
AVIInfo(vid,"fourCC",1)

but not

AviSource("cap.avi")
clip.AVIInfo("fourCC",1)

VirtualDub's File/Information dialog will also give you the fourcc.

kevinm
2nd September 2005, 19:07
thanks neuron2 but it still doesn't work, here is the actual script I am using ..

LoadPlugin("C:\Kevin\dvd_temp\AVISynth25\Plugins\AVIInfo.dll")

# 1st method ..
#AVISource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi").AVIInfo("fourcc",1)

# 2nd method ..
# AVISource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi")
# AVIInfo("fourCC",1)

# 3rd method ..
#vid=AVISource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi")
#vid.AVIInfo("fourCC",1)

# 4th method ..
vid=AviSource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi")
AVIInfo(vid,"fourCC",1)


.. I still get the same error, i.e "Script error: Invalid arguments to function "AVIInfo""

The error message also provides me the line number; it points to the AVIInfo(vid,"fourCC",1) line,

Kevin

Wilbert
2nd September 2005, 19:23
Please read the docs more carefully next time. But you are forgiven since i also forgot it :)

Try the following

c = blankclip()
vid="c:\kevin\dvd_temp\tape8_ntsc_1_1.avi" # without AviSource
c.Subtitle(AVIInfo(vid,"fourCC",1)) # AVIInfo returns a string

or

vid = "c:\kevin\dvd_temp\tape8_ntsc_1_1.avi" # without AviSource
AviSource(vid)
Subtitle(AVIInfo(vid,"fourCC",1)) # AVIInfo returns a string


The thing is that AVIInfo doesn't read any of the frames, it just reads the info from the header. So the scripts in the posts above won't work.

kevinm
2nd September 2005, 19:40
this is really strange, I no longer get the error message from AVIInfo (thanks again Wilbert!), but all I see is a black screen, in fact I get a black screen if I just load the clip. I think it is a case of trying to do two things at the same time :-(

I installed the Cedocida codec, and I think it is not installed corectly, or there is some sort of conflict. I followed the install.txt (did an install using the inf).

If I load my source AVI in gspot it lists three suitable codecs, I dont see Cedocida listed, however if I query the Panasonic one (which does show up in the list of suitable codecs), this is what I see ..


DSH 4CC DVSD
DSH Friendly Name Panasonic DV CODEC
DSH Driver or Wrapper C:\WINNT\system32\qcap.dll
DSH DirectShow CLSID CLSID_AVICo {D76E2820-1563-11CF-AC98-00AA004C0FA9}
VFW Name Cedocida DV codeCedocida DV codec (SD format) v0.1.6
VFW Driver File C:\WINNT\system32\cedocida.dll
VFW Description Cedocida DV codec (SD format) v0.1.6


I am not very familiar with gspot, but it seems to me odd that querying the entry for the Panasonic codec would show any sort of information for the Cedocida. Also, unlike the other two codecs gspot does not show and REG (registry?) entries for this codec.

I will check the homepage for Cedocida to see if there are any known install problems with this codec,

Kevin

mic
2nd September 2005, 20:57
Windows doesn't keep track, or let you choose which codecs are default, or the associated files & file versions used with the codec. Gspot or wmplayer properties will normally tell you what's used on your system, gspot being of course more detailed. You can have many codecs installed, but the final combinations of codec + filters Windows chooses for you, and it can choose poorly. :)

General troubleshooting for this sort of thing is to locate the various codecs & related you have installed, then rename the folders (add a leading _ for example). This disables stuff that might be competeing with what you want used. For locating files/filters, dxman from the analogx site is useful.

In the example given with mixed panasonic & Cedocida, this is an excellant example of windows using a mix of files that probably shouldn't be mixed.

You'll probably find a lot of info on the panasonic codec, including removal, by searching the forums here.

kevinm
2nd September 2005, 21:18
mic, thanks for the pointers.

I am getting somewhere ..

I ran vcswap and it told me that the Cedocida codec was installed ok (no sign of any mixup with the Panasonic one), the dll listed was the correct one. Also in vcswap I was able to bring up the configuration menu for the Cedocida codec, I left the settings at 'default'.

cvswap did flag a problem with a LEAD codec, so I deleted that - it didn't help though.

Anyway, even though vcswap said everything was ok I decided to use it to delete the Cedocida codec, then I exited vcswap and installed the codec again (using the .inf).


Next I tried running a slightly different AVS script, here are the two scripts I used ..


Test1:
=====
Input = AVISource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi") # Type2
Input = ConvertToYUY2(Input, interlaced=true)
return(Input)


Test2:
=====
Input = AVISource("c:\kevin\dvd_temp\tape8_ntsc_1_1.avi") # Type2
##Input = ConvertToYUY2(Input, interlaced=true)
return(Input)



Step1. Load Test1 into TMPGEnc => the clip loads ok

Step2. (in the same TMPGEnc session), load Test2 into
TMPGEnc => the clip also loads ok


However, if I shut down TMPGEnc and open it up again it remembers the last script which was run (i.e. Test2) and FAILS to load the clip (black screen).

What I have discovered is that I have to do a 'ConvertToYUY2' in my TMPGEnc session, after that I can load clips without any problem, even is the script I am loading doesn't have the ConvertToYUY2 !!

I am totally confused by all this :-(

Kevin

kevinm
2nd September 2005, 21:26
Used vcswap to configure the codec to force the output to YUY2, now I can load both scripts, regardless of whether I do a ConvertToYUY2

Don't fully understand what was going on but at least everything seems to be working now. This evening I have to try installing the codec on my home machine, hopefully that will go ok. I think I will use vcswap to remove the Panasonic codec before I install the Cedocida one,

Kevin

Wilbert
2nd September 2005, 21:26
I'm not sure how this is possible. But what happens (i guess) is that some codec is hijacking the YUY2->RGB conversion. Remember TMPGEnc requires RGB24. So, two solutions:

1) Use

ConvertToRGB24(Input, interlaced=true)

2) Install huffyuv and add the following to your registry


REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Drivers32]
"VIDC.YUY2"="huffyuv.dll"


The latter should take care of the YUY2->RGB when feeding YUY2 to TMPGEnc. BUT this will mess up your video if it is interlaced. So, if your video is interlaced your should use (1).

kevinm
2nd September 2005, 21:28
oh, forgot to mention that now I have the codec sorted out, AVIInfo is now working and tells me the fourcc is 'dvsd'

thanks,

Kevin

mic
2nd September 2005, 23:16
I'm not sure how this is possible. But what happens (i guess) is that some codec is hijacking the YUY2->RGB conversion.
FWIW, I've had similar happen a LOT with mpg2 related. One might install files of same version with codec-specific code, another might add registry entries that only their version will accept, sometimes can't figure out why there is an interaction, other times it's a surprise -> after installing Nero update have to set fomats to use wmplayer as default for VFAPI (least that one might make sense I guess).

Mug Funky
3rd September 2005, 04:32
The latter should take care of the YUY2->RGB when feeding YUY2 to TMPGEnc. BUT this will mess up your video if it is interlaced. So, if your video is interlaced your should use (1).

i thought that was for yv12 only... does yuy2->RGB also have to consider interlacing? i thought it only operates horizontally, but of course i could be mistaken...

Wilbert
3rd September 2005, 08:54
i thought that was for yv12 only... does yuy2->RGB also have to consider interlacing? i thought it only operates horizontally, but of course i could be mistaken...
No, you are right. Thanks for correct me.