X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=avi2swf%2Favi2swf.cc;h=2ce63c158ad4c3d5ee5937325597b8d869266b77;hb=c93d52568f86b5639d40e34e384e8115e0037b75;hp=7f6efe0251c2286d096e0731b9935e13f4c84abd;hpb=1b25c07d9d83006a693a956b962f80935e86aac3;p=swftools.git diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index 7f6efe0..2ce63c1 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"}, @@ -56,10 +57,11 @@ static struct options_t options[] = { {"n", "num"}, {"m", "mp3-bitrate"}, {"r", "mp3-samplerate"}, -{"d", "scale"}, -{"k", "keyframe"}, +{"s", "scale"}, +{"S", "skipframes"}, {"p", "flip"}, {"q", "quality"}, +{"k", "keyframe"}, {"x", "extragood"}, {"T", "flashversion"}, {"V", "version"}, @@ -76,6 +78,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) @@ -110,7 +120,7 @@ int args_callback_option(char*name,char*val) } else if(!strcmp(name, "m")) { mp3_bitrate = atoi(val); - return 0; + return 1; } else if(!strcmp(name, "r")) { samplerate = atoi(val); @@ -157,9 +167,11 @@ void args_callback_usage(char *name) printf("-n , --num frames Number of frames to encode\n"); printf("-m , --mp3-bitrate Set the mp3 bitrate to encode audio with\n"); printf("-r , --mp3-samplerate Set the mp3 samplerate to encode audio with (default: 11025)\n"); - printf("-d , --scale Scale down to factor . (in %, e.g. 100 = original size)\n"); + printf("-s , --scale Scale down to factor . (in %, e.g. 100 = original size)\n"); + printf("-S , --skipframes Skip frames before starting the conversion.\n"); printf("-p , --flip Turn movie upside down\n"); printf("-q , --quality Set the quality to . (0-100, 0=worst, 100=best, default:80)\n"); + printf("-k , --keyframe Set the number of intermediate frames between keyframes.\n"); printf("-x , --extragood Enable some *very* expensive compression strategies.\n"); printf("-T , --flashversion Set output flash version to .\n"); printf("-V , --version Print program version and exit\n"); @@ -258,6 +270,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");