Using Tee pseudo muxer of ffmpeg by c++ code.

Examples and samples for those who develop software with FFmpeg.
Post Reply
Taha
Posts: 12
Joined: Mon Feb 29, 2016 2:49 pm

Using Tee pseudo muxer of ffmpeg by c++ code.

Post by Taha » Thu Aug 17, 2017 4:12 am

Hello ,

Is there anyone who knows how to use Tee pseudo muxer of ffmpeg by c++ code. Kindly guide me to this.
I am working on getting multiple outputs of muxed transport stream (ts) data. I am able to mux aac and h264 in ts. But i have to get muxed ts data in multiple output.

So please guide me if anyone know how to do it with Tee pseudo muxer.

Taha
Posts: 12
Joined: Mon Feb 29, 2016 2:49 pm

Re: Using Tee pseudo muxer of ffmpeg by c++ code.

Post by Taha » Wed Aug 23, 2017 7:28 am

I have done this by myself, and i am sharing it here for others:
First do initialise AVFormatContext with tee container and output tee url like : avformat_alloc_output_context2(&m_oc, NULL, "tee", filename);
Here m_oc is AVFormatContext, tee is container and filename is outputs(like in filename: "[f=mpegts]udp://127.0.0.1:2222|[f=mpegts]udp://127.0.0.1:3333|[f=mp4]output.mp4")

then set avformat context with this filename as:
sprintf_s(m_oc->filename, "%s",filename);

and go with normal muxing.c sample flow provided by ffmpeg.

Post Reply