int main(int argc, char **argv)
{
int64_t ti;
av_log_set_flags(AV_LOG_SKIP_REPEATED);
parse_loglevel(argc, argv, options);
avcodec_register_all();
#if CONFIG_AVDEVICE
avdevice_register_all();
#endif
#if CONFIG_AVFILTER
avfilter_register_all();
#endif
av_register_all();
avformat_network_init();
avio_set_interrupt_cb(decode_interrupt_cb);
init_opts();
show_banner();
av_log(NULL, AV_LOG_WARNING, "*** THIS PROGRAM IS DEPRECATED ***\n"
"This program is only provided for compatibility "
"and will be removed in a future release. Please "
"use avconv instead.\n");
/* parse options */
parse_options(NULL, argc, argv, options, opt_output_file);
if(nb_output_files <= 0 && nb_input_files == 0) {
show_usage();
fprintf(stderr, "Use -h to get full help or, even better, run 'man ffmpeg'\n");
exit_program(1);
}
/* file converter / grab */
if (nb_output_files <= 0) {
fprintf(stderr, "At least one output file must be specified\n");
exit_program(1);
}
if (nb_input_files == 0) {
fprintf(stderr, "At least one input file must be specified\n");
exit_program(1);
}
ti = getutime();
if (transcode(output_files, nb_output_files, input_files, nb_input_files,
stream_maps, nb_stream_maps) < 0)
exit_program(1);
ti = getutime() - ti;
if (do_benchmark) {
int maxrss = getmaxrss() / 1024;
printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
}
exit_program(0);
return 0;
}
接下来就开始逐行阅读,随着代码阅读的过程,会逐渐的完善注释