tee muxer failing with error: Output file #0 does not contain any stream

tee muxer failing with error: Output file #0 does not contain any stream

我可以使用 ffmpeg 将带有 h264 编码视频和 aac 编码音频的 mp4 文件流式传输到 flash flv 输出。我使用的命令是:

ffmpeg -re -i bigbuckbunny_HD_60fps.mp4 -c copy -f flv rtmp://192.168.3.64:1935/main/stream0

当我尝试使用 tee 选项复制输出时,我失败了并出现错误。这是我使用的命令:

ffmpeg -re -i bigbuckbunny_HD_60fps.mp4 -c copy -f tee "[f=flv]rtmp://192.168.3.64:1935/main/stream0|[f=flv]rtmp://192.168.3.64:1935/main/stream1"

然而,它失败了。我缺少什么?我从 ffmpeg 得到的输出是:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bigbuckbunny_HD_60fps.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf54.29.104
  Duration: 00:10:34.58, start: 0.000000, bitrate: 4279 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 4141 kb/s, 60 fps, 60 tbr, 90k tbn, 120 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, tee, to '[f=flv]rtmp://192.168.3.64:1935/mainconcept/obs_stream|[f=flv]rtmp://192.168.3.64:1935/mainconcept/obs_stream1':
Output file #0 does not contain any stream

使用 tee muxer 时必须添加 -map 选项。来自 tee muxer documentation:

Since the tee muxer does not represent any particular output format, ffmpeg cannot auto-select output streams. So all streams intended for output must be specified using -map.

包含来自输​​入 (-map 0) 的所有流的示例:

ffmpeg -re -i bigbuckbunny_HD_60fps.mp4 -map 0 -c copy -f tee "[f=flv]rtmp://192.168.3.64:1935/main/stream0|[f=flv]rtmp://192.168.3.64:1935/main/stream1"

有关更多信息和示例,请参阅 FFmpeg Wiki: Map