如何播放具有多个视频流的视频?

How to play video with multiple video streams?

如题目所述,我有一个视频有多个视频流,我该如何播放这种视频?用ffplay播放时,好像只能播放第一个视频流,请问如何切换到其他视频流?

以下视频信息来自ffmpeg:

Duration: 00:00:19.97, start: 0.000000, bitrate: 1538035 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 31211 kb/s, 29.99 fps, 30 tbr, 1200k tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 31217 kb/s, 29.99 fps, 30 tbr, 1200k tbn, 60 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:2(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 31216 kb/s, 29.99 fps, 30 tbr, 1200k tbn, 60 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:3(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 31257 kb/s, 29.99 fps, 30 tbr, 1200k tbn, 60 tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:4(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080, 31266 kb/s, 29.99 fps, 30 tbr, 1200k tbn, 60 tbc
    Metadata:
      handler_name    : VideoHandler

VLC和ffplay都可以播放这种视频

  • VLC

单击“视频”->“视频轨道”以select 所需的视频流。

  • ffplay

使用ffplay播放时,点击"v"切换视频流

一个开源的媒体播放器ijkplayer也可以播放这种videos.Thedemo演示如何播放it.And源码中的相关接口是:

  1. select跟踪
  2. 去select跟踪