param->pix_fmt = opt->colorspace ? av_get_pix_fmt( opt->colorspace ) : PIX_FMT_YUV420P;
}
- FAIL_IF_ERROR( av_open_input_file( &h->lavf, psz_filename, NULL, 0, param ), "could not open input file\n" )
+ /* specify the input format. this is helpful when lavf fails to guess */
+ AVInputFormat *format = NULL;
+ if( opt->format )
+ FAIL_IF_ERROR( !(format = av_find_input_format( opt->format )), "unknown file format: %s\n", opt->format );
+
+ FAIL_IF_ERROR( av_open_input_file( &h->lavf, psz_filename, format, 0, param ), "could not open input file\n" )
if( param )
free( param );
FAIL_IF_ERROR( av_find_stream_info( h->lavf ) < 0, "could not find input stream info\n" )
" - %s\n", muxer_names[0], stringify_names( buf, muxer_names ) );
H1( " --demuxer <string> Specify input container format [\"%s\"]\n"
" - %s\n", demuxer_names[0], stringify_names( buf, demuxer_names ) );
+ H1( " --input-fmt <string> Specify input file format (requires lavf support)\n" );
H1( " --input-csp <string> Specify input colorspace format for raw input\n" );
print_csp_names( longhelp );
H1( " --input-depth <integer> Specify input bit depth for raw input\n" );
OPT_PULLDOWN,
OPT_LOG_LEVEL,
OPT_VIDEO_FILTER,
+ OPT_INPUT_FMT,
OPT_INPUT_RES,
OPT_INPUT_CSP,
OPT_INPUT_DEPTH,
{ "frame-packing", required_argument, NULL, 0 },
{ "vf", required_argument, NULL, OPT_VIDEO_FILTER },
{ "video-filter", required_argument, NULL, OPT_VIDEO_FILTER },
+ { "input-fmt", required_argument, NULL, OPT_INPUT_FMT },
{ "input-res", required_argument, NULL, OPT_INPUT_RES },
{ "input-csp", required_argument, NULL, OPT_INPUT_CSP },
{ "input-depth", required_argument, NULL, OPT_INPUT_DEPTH },
case OPT_VIDEO_FILTER:
vid_filters = optarg;
break;
+ case OPT_INPUT_FMT:
+ input_opt.format = optarg;
+ break;
case OPT_INPUT_RES:
input_opt.resolution = optarg;
break;