TEE muxer and missing mpegts_flags

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

TEE muxer and missing mpegts_flags

alexdjca
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://239.33.33.33:7000
Process 2: ffmpeg -i input -c:v libx264 -c:a libfdk_aac -f mpegts udp://239.33.33.33:6000

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://239.33.33.33:7000|[f=mpegts,select=\'0,2\']udp://239.33.33.33:6000"

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://239.5.99.120:7000?pkt_size=1316': error writing header: Invalid data found when processing input

Where am I wrong?
Any suggestion?

Thanks in advance.

Alex Molon
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: TEE muxer and missing mpegts_flags

Gyan


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://239.33.33.33:7000
> Process 2: ffmpeg -i input -c:v libx264 -c:a libfdk_aac -f mpegts udp://239.33.33.33:6000
>
> 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://239.33.33.33:7000|[f=mpegts,select=\'0,2\']udp://239.33.33.33:6000"
>
> 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://239.5.99.120:7000?pkt_size=1316': 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

     f=mpegts:mpegts_flags=latm,select=\'0,1\'

becomes

     f=mpegts:mpegts_flags=latm:select=\'0,1\'


Same for

     f=mpegts,select=\'0,2\'

Next,

-latm 1 -profile:a: aac_he

applies these options to both audio encodes.

Change to

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


Gyan

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: TEE muxer and missing mpegts_flags

alexdjca
Hi Gyan,

Actually most of the errors were made just because I wrote the command in the email rather than copying the command I was issuing.

Actually I was already using columns and not commas, but definitely the error was in how I was using the -latm option.

I though latm was related to the previous flag option, so I didn't think to suffix :a:0

Your help was extremely clarifying, thanks a lot.

I've end up doing this:

/usr/src/ffmpeg-4.1.3/ffmpeg -v verbose -hwaccel cuvid -c:v h264_cuvid -i "udp://226.45.23.147:2001?fifo_size=1000000" -vf scale_npp=1280:720:format=yuv420p,hwdownload -map 0:v -map 0:a -map 0:a -r 25 -g 50 -c:v h264_nvenc -c:a libfdk_aac -flags:a:0 +global_header -latm:a:0 1 -profile:a:0 aac_he -c:a:1 libfdk_aac -f tee "[f=mpegts:mpegts_flags=latm:select=\'0,1\']udp://239.99.33.33:7000?pkt_size=1316&ttl=15|[f=mpegts:select=\'0,2\']udp://239.99.33.33:6000?pkt_size=1316&ttl=15"

And actually now does exactly what I need.

Thank you, really

Alex


-----Original Message-----
From: ffmpeg-user [mailto:[hidden email]] On Behalf Of Gyan
Sent: 26 June 2019 12:38
To: [hidden email]
Subject: Re: [FFmpeg-user] TEE muxer and missing mpegts_flags



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://239.33.33.33:7000
> Process 2: ffmpeg -i input -c:v libx264 -c:a libfdk_aac -f mpegts udp://239.33.33.33:6000
>
> 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://239.33.33.33:7000|[f=mpegts,select=\'0,2\']udp://239.33.33.33:6000"
>
> 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://239.5.99.120:7000?pkt_size=1316': 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

     f=mpegts:mpegts_flags=latm,select=\'0,1\'

becomes

     f=mpegts:mpegts_flags=latm:select=\'0,1\'


Same for

     f=mpegts,select=\'0,2\'

Next,

-latm 1 -profile:a: aac_he

applies these options to both audio encodes.

Change to

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


Gyan

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".