• ffmpeg开发系列-源码阅读


    还是回到最初的源码阅读, 读到哪算哪吧


    int main(int argc, char **argv)
    {
        int ret;
        int64_t ti;
    
        register_exit(ffmpeg_cleanup);
    
        setvbuf(stderr,NULL,_IONBF,0); /* win32 runtime needs this */
    
        av_log_set_flags(AV_LOG_SKIP_REPEATED);
        parse_loglevel(argc, argv, options);
    
        if(argc>1 && !strcmp(argv[1], "-d")){
            run_as_daemon=1;
            av_log_set_callback(log_callback_null);
            argc--;
            argv++;
        }
    
        avcodec_register_all();
    #if CONFIG_AVDEVICE
        avdevice_register_all();
    #endif
        avfilter_register_all();
        av_register_all();
        avformat_network_init();
    
        show_banner(argc, argv, options);
    
        term_init();
    
        /* parse options and open all input/output files */
        ret = ffmpeg_parse_options(argc, argv);
        if (ret < 0)
            exit_program(1);
    
        if (nb_output_files <= 0 && nb_input_files == 0) {
            show_usage();
            av_log(NULL, AV_LOG_WARNING, "Use -h to get full help or, even better, run 'man %s'
    ", program_name);
            exit_program(1);
        }
    
        /* file converter / grab */
        if (nb_output_files <= 0) {
            av_log(NULL, AV_LOG_FATAL, "At least one output file must be specified
    ");
            exit_program(1);
        }
    
    //     if (nb_input_files == 0) {
    //         av_log(NULL, AV_LOG_FATAL, "At least one input file must be specified
    ");
    //         exit_program(1);
    //     }
    
        current_time = ti = getutime();
        if (transcode() < 0)
            exit_program(1);
        ti = getutime() - ti;
        if (do_benchmark) {
            printf("bench: utime=%0.3fs
    ", ti / 1000000.0);
        }
        av_log(NULL, AV_LOG_DEBUG, "%"PRIu64" frames successfully decoded, %"PRIu64" decoding errors
    ",
               decode_error_stat[0], decode_error_stat[1]);
        if (2*decode_error_stat[0] < decode_error_stat[1])
            exit_program(254);
    
        exit_program(received_nb_signals ? 255 : 0);
        return 0;
    }


    每天早上叫醒你的不是闹钟,而是心中的梦~
  • 相关阅读:
    共用体
    位运算符和位运算
    python中while循环
    c语言中求多个整数的和及其平均值
    c语言中switch语句
    python中删除列表中多次重复的元素
    python中while循环
    python中break语句
    使用用户输入来填充字典
    python中while循环使用标志
  • 原文地址:https://www.cnblogs.com/vintion/p/4116950.html
Copyright © 2020-2023  润新知