[gst-devel] Finding out resolution of video of input file using decodebin2?

Alberto Vigata alberto at nelalabs.com
Thu Jun 17 09:15:28 CEST 2010


Definitely not optimal to end using ffmpeg to do media discovery when
you are trying to build a solution based on GStreamer...

AVP

On Thu, Jun 17, 2010 at 12:09 AM, wl2776 <wl2776 at gmail.com> wrote:
>
>
> wl2776 wrote:
>>
>> http://gstreamer-devel.966125.n4.nabble.com/How-can-I-get-full-information-about-a-media-file-tp1745331p1745534.html
>>
>
> However, using FFmpeg seems to be more convenient to me.
> Since gst-ffmpeg is installed, FFmpeg libraries (libavformat, libavcodec,
> libavutil ) are installed also.
>
> It is as easy as:
>
>
> AVFormatContext *input;
> char *filename;
>
> // create the filename
>
> int r=av_open_input_file(&input,filename,NULL,0,NULL);
> if(!r){
>  r=av_find_stream_info(input);
>  if(r>=0){
> // iterate all media streams in the file.
>    for(int j=0;j<input->nb_streams;j++){
>       if(input->streams[j]->codec->codec_type==CODEC_TYPE_VIDEO){
>          //extract video stream properties.
>       }
>       if(input->streams[j]->codec->codec_type==CODEC_TYPE_AUDIO){
>         // extract audio stream properties.
>       }
>    }
>  }
>  av_close_input_file(input);
> }
>
>
> More details are here: http://ffmpeg.org/documentation.html
> Please, see the "Public API Documentation"
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Finding-out-resolution-of-video-of-input-file-using-decodebin2-tp2258081p2258288.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>




More information about the gstreamer-devel mailing list