X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=avi2swf%2Favi2swf.cc;h=7f6efe0251c2286d096e0731b9935e13f4c84abd;hb=2e97146113d27825e4ef9acf221b298de3b0c326;hp=82d70c660ff8311cf0e5cb0e11a33f65c2131fd6;hpb=95c9749e83bf6b3222f5d1a7b880c6c32bd0914a;p=swftools.git diff --git a/avi2swf/avi2swf.cc b/avi2swf/avi2swf.cc index 82d70c6..7f6efe0 100644 --- a/avi2swf/avi2swf.cc +++ b/avi2swf/avi2swf.cc @@ -57,6 +57,7 @@ static struct options_t options[] = { {"m", "mp3-bitrate"}, {"r", "mp3-samplerate"}, {"d", "scale"}, +{"k", "keyframe"}, {"p", "flip"}, {"q", "quality"}, {"x", "extragood"}, @@ -87,6 +88,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; @@ -150,8 +155,8 @@ void args_callback_usage(char *name) printf("-o , --output filename Specify output filename\n"); printf("-A , --adjust seconds Audio adjust: Shift sound -seconds to the future or +seconds into the past.\n"); printf("-n , --num frames Number of frames to encode\n"); - printf("-m , --mp3-bitrate (kbps) Set the mp3 bitrate to encode audio with\n"); - printf("-r , --mp3-samplerate (Hz) Set the mp3 samplerate to encode audio with (default: 11025)\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("-p , --flip Turn movie upside down\n"); printf("-q , --quality Set the quality to . (0-100, 0=worst, 100=best, default:80)\n"); @@ -214,11 +219,13 @@ int main (int argc,char ** argv) #endif processargs(argc, argv); - if(!filename) + if(!filename) { + fprintf(stderr, "You must supply a filename"); exit(0); + } if(keyframe_interval<0) { if(flashversion>=6) - keyframe_interval=200; + keyframe_interval=20; else keyframe_interval=5; } @@ -229,15 +236,15 @@ int main (int argc,char ** argv) fprintf(stderr, "Couldn't open %s\n", outputfilename); exit(1); } - + #ifdef WIN32 ret = videoreader_vfw_open(&video, filename); #else ret = videoreader_avifile_open(&video, filename); #endif - if(!ret) { - printf("Error opening %s\n", filename); + if(ret<0) { + fprintf(stderr, "Error opening %s\n", filename); exit(1); }