X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=avi2swf%2Favi2swf.cc;h=a9e4619fe4230848be5657326d831ffe38fcf553;hb=04579d8c98b30fec6afa470109f0b9042edb7033;hp=bdc97a41c79d39306c3c65333f7de8a37bb82475;hpb=0a76f065a794ed8623118a2c61e79c82d5b6f676;p=swftools.git diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index bdc97a4..a9e4619 100644 --- a/avi2swf/avi2swf.cc +++ b/avi2swf/avi2swf.cc @@ -48,6 +48,7 @@ static int skip = 0; static float audio_adjust = 0; static int mp3_bitrate = 32; static int samplerate = 11025; +static int numframes = 0; static struct options_t options[] = { {"h", "help"}, @@ -57,6 +58,7 @@ static struct options_t options[] = { {"m", "mp3-bitrate"}, {"r", "mp3-samplerate"}, {"d", "scale"}, +{"k", "keyframe"}, {"p", "flip"}, {"q", "quality"}, {"x", "extragood"}, @@ -75,6 +77,14 @@ int args_callback_option(char*name,char*val) outputfilename = val; return 1; } + else if(!strcmp(name, "n")) { + numframes = atoi(val); + return 1; + } + else if(!strcmp(name, "d")) { + scale = atof(val); + return 1; + } else if(!strcmp(name, "q")) { quality = atoi(val); if(quality<0) @@ -87,6 +97,10 @@ int args_callback_option(char*name,char*val) flip = 1; return 0; } + else if(!strcmp(name, "k")) { + keyframe_interval = atoi(val); + return 1; + } else if(!strcmp(name, "A")) { audio_adjust = atof(val); return 1; @@ -220,7 +234,7 @@ int main (int argc,char ** argv) } if(keyframe_interval<0) { if(flashversion>=6) - keyframe_interval=200; + keyframe_interval=20; else keyframe_interval=5; } @@ -239,7 +253,7 @@ int main (int argc,char ** argv) #endif if(ret<0) { - printf("Error opening %s\n", filename); + fprintf(stderr, "Error opening %s\n", filename); exit(1); } @@ -253,6 +267,8 @@ int main (int argc,char ** argv) ret = v2swf_init(&v2swf, &video); if(verbose) v2swf_setparameter(&v2swf, "verbose", "1"); + if(numframes) + v2swf_setparameter(&v2swf, "numframes", itoa(numframes)); v2swf_setparameter(&v2swf, "quality", itoa(quality)); v2swf_setparameter(&v2swf, "blockdiff", "0"); v2swf_setparameter(&v2swf, "blockdiff_mode", "exact");