PDA

View Full Version : VirtualDub.video.SetCompression and HuffYUV


chaynik
23rd November 2008, 12:33
I'd like to utilize VirtualDub's command line/scripting options to do some batch processing. All I really need to do is open an AVISynth script, set the processing mode to "fast recompress" and export the AVI with the HuffYUV codec. This is my VCF file:


VirtualDub.Open("clip.avs",0,0);
VirtualDub.video.SetMode(1);
VirtualDub.video.SetCompression(HFYU);
VirtualDub.SaveAVI("clip_huffyuv.avi");


However, it doesn't work and VirtualDub returns with an error:
http://i38.tinypic.com/34xo08m.png

This leads me to believe that the variable for SetCompression is something other than the FourCC of the codec, which is what I assumed, as the VirtualDub scripting reference document is a bit confusing to me on this topic:


void SetCompression(int fccHandler, int keyrate, int quality, int datarate);

The argumentless syntax turns off video compression. The other two
syntaxes select a video compressor. Note that the fccHandler can be
specified as either an integer or a string. If the string is shorter
than 4 bytes, it is padded with spaces.


Any help would be greatly appreciated!

squid_80
23rd November 2008, 14:06
Try VirtualDub.video.SetCompression("HFYU",0,10000,0).

chaynik
24th November 2008, 02:52
Thanks for the response, but unfortunately that didn't work. VirtualDub is still reporting "Variable 'HFYU' not found. I suspect the variable needs to be some sort of encoded string, as per this thread: http://forum.doom9.org/showthread.php?t=54378. But I'm not sure how to come up with that string...

squid_80
24th November 2008, 03:07
Did you use the quotes around HFYU?
Well, let's try the other way then: VirtualDub.video.SetCompression(0x75796668,0,10000,0)

chaynik
30th November 2008, 01:18
The quotes were it! Sometimes we miss the silliest things... Thank you!

Out of curiosity, how were you able to come up with the '0x75796668' value?

squid_80
4th December 2008, 13:54
ASCII Hex codes:
H = 0x68
F = 0x66
Y = 0x79
U = 0x75
Then stick them all together in reverse; Intel PCs are little-endian so the least significant byte goes first.