Skip to content
Snippets Groups Projects
ffmpeg.c 146 KiB
Newer Older
  • Learn to ignore specific revisions
  •     { "absf", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
        { "vbsf", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
        { "sbsf", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_bsf}, "", "bitstream_filter" },
    
        { "apre", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_EXPERT, {(void*)opt_preset}, "set the audio options to the indicated preset", "preset" },
        { "vpre", OPT_FUNC2 | HAS_ARG | OPT_VIDEO | OPT_EXPERT, {(void*)opt_preset}, "set the video options to the indicated preset", "preset" },
        { "spre", OPT_FUNC2 | HAS_ARG | OPT_SUBTITLE | OPT_EXPERT, {(void*)opt_preset}, "set the subtitle options to the indicated preset", "preset" },
    
        { "fpre", OPT_FUNC2 | HAS_ARG | OPT_EXPERT, {(void*)opt_preset}, "set options from indicated preset file", "filename" },
    
        { "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
    
    Fabrice Bellard's avatar
    Fabrice Bellard committed
        { NULL, },
    };
    
    
    int main(int argc, char **argv)
    {
        int i;
        int64_t ti;
    
    
    Luca Abeni's avatar
    Luca Abeni committed
        avcodec_register_all();
        avdevice_register_all();
    
        av_register_all();
    
    
    Martin Storsjö's avatar
    Martin Storsjö committed
    #if HAVE_ISATTY
    
        if(isatty(STDIN_FILENO))
            url_set_interrupt_cb(decode_interrupt_cb);
    
    Martin Storsjö's avatar
    Martin Storsjö committed
    #endif
    
        for(i=0; i<CODEC_TYPE_NB; i++){
    
            avcodec_opts[i]= avcodec_alloc_context2(i);
    
        avformat_opts = avformat_alloc_context();
    
        sws_opts = sws_getContext(16,16,0, 16,16,0, sws_flags, NULL,NULL,NULL);
    
    
    
        /* parse options */
        parse_options(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");
            av_exit(1);
        }
    
        /* file converter / grab */
        if (nb_output_files <= 0) {
    
            fprintf(stderr, "At least one output file must be specified\n");
    
        }
    
        if (nb_input_files == 0) {
    
            fprintf(stderr, "At least one input file must be specified\n");
    
        }
    
        ti = getutime();
    
        if (av_encode(output_files, nb_output_files, input_files, nb_input_files,
                      stream_maps, nb_stream_maps) < 0)
            av_exit(1);
    
        ti = getutime() - ti;
        if (do_benchmark) {
    
            int maxrss = getmaxrss() / 1024;
            printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);