View Full Version : VirtualDub.video.SetCompression string question
InuyashaSama
29th April 2006, 21:00
In the program I'm developing I can call the codec compression dialog, which return the settings in the AVICOMPRESSOPTIONS (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/multimed/htm/_win32_avicompressoptions_str.asp) structure.
Any ideas on how to convert these parameters into the Base64 string used by VD scripts? Thanks in advance.
Edit: the correct parameter name is VirtualDub.video.SetCompData
dloneranger
4th May 2006, 22:19
It's just a standard base64 compression, where the number before the string is the uncompressed length.
eg
VirtualDub.video.SetCompData(107,"LWJ2MXEgNSAtdmJ2IDQ4NTQwMDAsMzE0NTcyOCwyMzU5Mjk2IC1kaXIgQzpcIC1wcSA4NjEwIC1iIDEgLXNjIDQzIC1rZXkgMjUwIC1uZiAtcHJvZmlsZT0zIC10aHJlYWRfZGVsYXk9MQA=");
decompresses to 107 bytes.
I normally add an extra #0 to the end of the uncompressed buffer if i'm going to feed it back into the compressor to set the configuration, after a nasty experience with divx changing it's format.
You should be able to find the routine in the source code for virtualdub easily enough, or any coding website.
I'd paste it here, but I program in delphi so mine probably wouldn't help you.
Heres one for C though
http://www.doomdead.com/texts/cryptography/base.htm
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.