X-Git-Url: http://research.m1stereo.tv/gitweb?a=blobdiff_plain;f=src%2Fmodules%2Favformat%2Fproducer_avformat.c;h=c6c013553409fe25da7347efc12e0733e0fcebe9;hb=35bfd1603d15f70354524f4d59eab2f7b4eb4946;hp=8cbdad442c20077ba6d62422e78cf2354e18b1f8;hpb=6feb43a276bbc0dd161b1cd746300959324147a2;p=melted diff --git a/src/modules/avformat/producer_avformat.c b/src/modules/avformat/producer_avformat.c index 8cbdad4..c6c0135 100644 --- a/src/modules/avformat/producer_avformat.c +++ b/src/modules/avformat/producer_avformat.c @@ -287,6 +287,15 @@ static int producer_open( mlt_producer this, char *file ) // Store selected audio and video indexes on properties mlt_properties_set_int( properties, "audio_index", audio_index ); mlt_properties_set_int( properties, "video_index", video_index ); + + // Fetch the width, height and aspect ratio + if ( video_index != -1 ) + { + AVCodecContext *codec_context = context->streams[ video_index ]->codec; + mlt_properties_set_int( properties, "width", codec_context->width ); + mlt_properties_set_int( properties, "height", codec_context->height ); + mlt_properties_set_double( properties, "aspect_ratio", av_q2d( codec_context->sample_aspect_ratio ) ); + } // We're going to cheat here - for a/v files, we will have two contexts (reasoning will be clear later) if ( av == 0 && !av_bypass && audio_index != -1 && video_index != -1 )