[FFmpeg-user] TEE muxer and missing mpegts_flags

Gyan ffmpeg at gyani.pro
Wed Jun 26 14:38:26 EEST 2019

On 26-06-2019 03:56 PM, Alex Molon wrote:
> Hi All,
> I need to live encode a video and send it to two separate UDP outputs with different settings, since the only difference is  the audio track, I was thinking to use the TEE muxer but I don't know how to pass a mpegts_flag
> At the moment I'm using two different processes, but I'm wasting CPU resources:
> Process 1: ffmpeg -i input -c:v libx264 -c:a libfdk_aac -flags:a +global_header -latm 1 -profile:a aac_he -mpegts_flags latm -f mpegts udp://
> Process 2: ffmpeg -i input -c:v libx264 -c:a libfdk_aac -f mpegts udp://
> So I've tried with something like this:
> ffmpeg -i input -map 0:v -map 0:a -map 0:a -c:v libx264 -c:a libfdk_aac -flags:a:0  +global_header -latm 1 -profile:a: aac_he -f tee "[f=mpegts:mpegts_flags=latm,select=\'0,1\']udp://|[f=mpegts,select=\'0,2\']udp://"
> but it sems the option mpegts_flags=latm is totally ignored since I can see this error:
> [LATM/LOAS muxer @ 0x55f4f9d038c0] Muxing MPEG-4 AOT 21 in LATM is not supported
> [tee @ 0x55f4f6689600] Slave '[f=mpegts:mpegts_flags=latm:select='0,4']udp://': error writing header: Invalid data found when processing input
> Where am I wrong?
> Any suggestion?

A few things are wrong. Options for a slave muxer are separated by a 
colon ':'  so




Same for



-latm 1 -profile:a: aac_he

applies these options to both audio encodes.

Change to

-latm:a:0 1 -profile:a:0 aac_he


More information about the ffmpeg-user mailing list