[gst-devel] Finding out resolution of video of input file using decodebin2?
wl2776
wl2776 at gmail.com
Thu Jun 17 09:09:33 CEST 2010
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.
More information about the gstreamer-devel
mailing list