From: ddennedy Date: Tue, 6 Jan 2009 06:08:22 +0000 (+0000) Subject: producer_avformat.{c,yml}: support special constructor argument values to list availa... X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=61a1fd80791f7ff2042756814b2868c797426b9a;p=melted producer_avformat.{c,yml}: support special constructor argument values to list available demuxers and decoders: f-list[[,]acodec-list][[,]vcodec-list] git-svn-id: https://mlt.svn.sourceforge.net/svnroot/mlt/trunk/mlt@1308 d19143bc-622f-0410-bfdd-b5b2a6649095 --- diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 4ddec9a..b5fd38a 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -51,6 +51,41 @@ static int producer_get_frame( mlt_producer this, mlt_frame_ptr frame, int index mlt_producer producer_avformat_init( mlt_profile profile, char *file ) { + int error = 0; + + // Report information about available demuxers and codecs as YAML Tiny + if ( file && strstr( file, "f-list" ) ) + { + fprintf( stderr, "---\nformats:\n" ); + AVInputFormat *format = NULL; + while ( ( format = av_iformat_next( format ) ) ) + fprintf( stderr, " - %s\n", format->name ); + fprintf( stderr, "...\n" ); + error = 1; + } + if ( file && strstr( file, "acodec-list" ) ) + { + fprintf( stderr, "---\naudio_codecs:\n" ); + AVCodec *codec = NULL; + while ( ( codec = av_codec_next( codec ) ) ) + if ( codec->decode && codec->type == CODEC_TYPE_AUDIO ) + fprintf( stderr, " - %s\n", codec->name ); + fprintf( stderr, "...\n" ); + error = 1; + } + if ( file && strstr( file, "vcodec-list" ) ) + { + fprintf( stderr, "---\nvideo_codecs:\n" ); + AVCodec *codec = NULL; + while ( ( codec = av_codec_next( codec ) ) ) + if ( codec->decode && codec->type == CODEC_TYPE_VIDEO ) + fprintf( stderr, " - %s\n", codec->name ); + fprintf( stderr, "...\n" ); + error = 1; + } + if ( error ) + return NULL; + mlt_producer this = NULL; // Check that we have a non-NULL argument diff --git a/src/modules/avformat/producer_avformat.yml b/src/modules/avformat/producer_avformat.yml index 5bc8dee..86ce738 100644 --- a/src/modules/avformat/producer_avformat.yml +++ b/src/modules/avformat/producer_avformat.yml @@ -64,7 +64,9 @@ parameters: For example, video4linux:/dev/video1?width:320&height:240 Note: on the bash command line, & must be escaped as '\&'. Also, note the use of ':' instead of '=' for parameters. - Use 'ffmpeg -formats' to see a list of supported protocols and formats. + Use 'f-list' to see a list of supported file formats. + Use 'vcodec-list' to see a list of supported video decoders. + Use 'acodec-list' to see a list of supported audio decoders. readonly: no required: yes mutable: no