[Libav-user] reading video with multiple video streams

Svetlana Olonetsky svetlana.olonetsky at gmail.com
Mon Oct 22 10:01:12 CEST 2012


Thank you !

In our example we decided to go with codec_info_nb_frames != 1 in case 2
video streams exist.

Svetlana

On Sun, Oct 21, 2012 at 9:18 PM, Michael Bradshaw <
mbradshaw at sorensonmedia.com> wrote:

> On Sun, Oct 21, 2012 at 2:24 AM, Svetlana Olonetsky
> <svetlana.olonetsky at gmail.com> wrote:
> > Hi,
> >
> > I am reading video files using ffmpeg in C++.
> > I have some videos from users with multiple video streams.
> >
> > For example, running ffmpeg directly gives stream info:
> > Stream #0:0: Video: mjpeg, yuvj420p, 640x480, 90k tbr, 90k tbn, 90k tbc
> >     Metadata:
> >       comment         : Movie/video screen capture
> >     Stream #0:1(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 48000 Hz,
> stereo,
> > s16, 192 kb/s
> >     Stream #0:2(eng): Video: wmv3 (Main) (WMV3 / 0x33564D57), yuv420p,
> > 640x480, 5500 kb/s, 29.97 tbr, 1k tbn, 1k tbc
> >
> > How can I figure out which video stream is Main ?
>
> I'm not sure what the most appropriate method is, but I would probably
> pick the stream with the longest duration. Stream 0:0 is probably just
> a thumbnail/single frame, whereas stream 0:2 is probably an actual
> video. Check AVStream.duration (if it's set).
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20121022/7a1ccf22/attachment.html>


More information about the Libav-user mailing list