View Full Version : How to pass the XviD codec parameters ?
ookzDVD
17th June 2002, 08:20
Dear forum,
Sorry for asking this to this forum,
I really want to know how to pass the codec parameters
to the VirtualDub script ?
void SetCompData(int length, string data);
What should I pass to the length and data ?
Is there a documentation to "compose" the length and data based
on the XviD codec parameters used?
Thank you.
DaveEL
17th June 2002, 10:46
the data structure you need to put the information in is
typedef struct
{
/********** ATTENTION **********/
int mode; // Vidomi directly accesses these vars
int rc_bitrate; //
int desired_size; // please try to avoid modifications here
char stats1[MAX_PATH]; //
/*******************************/
int quality;
int quant;
int rc_reaction_delay_factor;
int rc_averaging_period;
int rc_buffer;
int motion_search;
int quant_type;
int fourcc_used;
int max_key_interval;
int min_key_interval;
int lum_masking;
int interlacing;
int min_iquant;
int max_iquant;
int min_pquant;
int max_pquant;
BYTE qmatrix_intra[64];
BYTE qmatrix_inter[64];
int keyframe_boost;
int discard1pass;
int dummy2pass;
int curve_compression_high;
int curve_compression_low;
int use_alt_curve;
int alt_curve_use_auto;
int alt_curve_auto_str;
int alt_curve_use_auto_bonus_bias;
int alt_curve_bonus_bias;
int alt_curve_type;
int alt_curve_high_dist;
int alt_curve_low_dist;
int alt_curve_min_rel_qual;
int twopass_max_bitrate;
int twopass_max_overflow_improvement;
int twopass_max_overflow_degradation;
int bitrate_payback_delay;
int bitrate_payback_method;
int hinted_me;
char hintfile[MAX_PATH];
char stats2[MAX_PATH];
int credits_start;
int credits_start_begin;
int credits_start_end;
int credits_end;
int credits_end_begin;
int credits_end_end;
int credits_mode;
int credits_rate;
int credits_quant_i;
int credits_quant_p;
int credits_start_size;
int credits_end_size;
// char build[50];
DWORD cpu;
float fquant;
BOOL save;
} CONFIG;
The size is the size of that struct (cant remeber off hand but its easy to calculate)
and the data has to be base64 encoded before written to the Vdub script
DaveEL.
ookzDVD
17th June 2002, 11:58
@DaveEL,
thank you for the info. ;)
Could some give me a simple example ? ;)
You know.. I'm not a smart guy.
DaveEL
17th June 2002, 14:58
You dont get simple examples im afraid you have to give it all the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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAXHZpZGVvZ2suc3RhdHMAAC4AcwB0AGEAdABzAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABQAAAAUAAAAECcAABAnAAAAAAAAAAAAAAEAAAAA");
Which is a first pass with default options :).
If your trying to write this in a program give me another shout with what language your writing in.
DaveEL
ookzDVD
18th June 2002, 04:52
@DaveEL,
thank you again,
I think I can learn and try from VirtualDub save processing settings ;)
DaveEL
18th June 2002, 06:41
Originally posted by ookzDVD
@DaveEL,
thank you again,
I think I can learn and try from VirtualDub save processing settings ;)
One thing to note is that each set of 3 bytes in the input is output to 4 bytes in the file due to base64 encode
so first 4 bytes in job file repeasents the first 3 bytes in the mode param and the next 4 bytes represents the last byte of mode and the first 2 bytes of rc_bitrate etc etc.
this makes it quite hard to do by just looking at the output.
DaveEL
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.