0

有没有人知道如何通过 c++ 代码使用ffmpeg的Tee 伪复用器。请指导这样做。我正在努力获取多路复用传输流 (ts) 数据的多个输出。我能够在 ts 中复用 aac 和 h264。但我必须在多个输出中获取多路复用的 ts 数据。

因此,如果有人知道如何使用Tee 伪 muxer进行操作,请指导我。

4

1 回答 1

0

我自己做了这个,我在这里分享给其他人:首先用 tee 容器初始化 AVFormatContext 并输出 tee url,如:avformat_alloc_output_context2(&m_oc, NULL, "tee", filename); 这里 m_oc 是 AVFormatContext,tee 是容器,文件名是输出(如文件名:“[f=mpegts]udp://127.0.0.1:2222|[f=mpegts]udp://127.0.0.1:3333|[f =mp4]输出.mp4" )

然后将此文件名设置为 avformat 上下文: sprintf_s(m_oc->filename, "%s",filename);

并使用 ffmpeg 提供的正常 muxing.c 示例流程。

于 2017-08-23T11:38:46.197 回答