[FFmpeg-user] Maximum argument length for tee pseudo muxer

luke harrison looxonline at gmail.com
Wed Mar 22 11:47:28 EET 2017

On Wed, Mar 22, 2017 at 11:38 AM, Marton Balint <cus at passwd.hu> wrote:

> On Wed, 22 Mar 2017, luke harrison wrote:
> I'm preparing a script to take a feed coming in over SDI and encode it into
>> multiple video and audio streams, all for distribution to different stream
>> paths using the tee muxer.
>> I'm sending quite a few different mixes of the streams to an RTMP server
>> which means that my tee muxer is taking quite a large argument. My command
>> line is shown below.
>> ffmpeg -threads 0 -f decklink -i 'UltraStudio Mini Recorder at 11' -loglevel
>> debug \
>> -filter_complex
>> "[0:v]split=2[VID1][VID2];[0:a]channelsplit=channel_layout=s
>> tereo[AL][AR]"
>> -map '[AR]' -map '[AL]' -map '[VID1]' -map '[VID2]' -flags +global_header
>> -c:v libx264 -profile:v high -preset veryfast -pix_fmt yuv420p -r 25
>> -s:v:0
>> 640x360 -s:v:1 426x240  -b:v:0 484k -b:v:1 215k -bufsize 1500k -coder 1 -g
>> 125 -keyint_min 25 -c:a aac -b:a 64k -ar 44100 -async 1 -rtmp_flashver
>> "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live -f tee
>> "[select=\'a:0,v:0\':f=flv]'${entrypoint}${streampath1}${datavid11}'|
>> \
>>    [select=\'a:1,v:0\':f=flv]'${entrypoint}${streampath2}${datavid11}'| \
>>    [select=\'a:0,v:1\':f=flv]'${entrypoint}${streampath1}${datavid12}'| \
>>    [select=\'a:1,v:1\':f=flv]'${entrypoint}${streampath2}${datavid12}'| \
>>    [select=\'a:0\':f=flv]'${entrypoint}${streampath1}${dataaud11}'| \
>>    [select=\'a:1\':f=flv]'${entrypoint}${streampath2}${dataaud11}'"
>> All of the output streams up until the last one (with a:1) connect to the
>> server and begin streaming. The issue comes when ffmpeg tries to connect
>> to
>> the final stream. The stream path is cut off for some reason. This results
>> in ffmpeg trying to connect to a stream path that is incomplete and
>> therefore failing.
>> [tcp @ 0x7fa0dc414180] Failed to resolve hostname p.epXXXXXX.i.ak:
>> nodename
>> nor servname provided, or not known
>> [rtmp @ 0x7fa0dc414100] Cannot open connection tcp://p.epXXXXX.i.ak:1935
>> [tee @ 0x7fa0de801800] Slave
>> '[select='a:1':f=flv]rtmp://XXXXXXX:XXXXXXX@p.epXXXXXX.i.ak': error
>> opening: Input/output error
>> [tee @ 0x7fa0de801800] Slave muxer #5 failed, aborting.
>> I have confirmed that removing characters within the inverted commas ("")
>> after the tee statement allows more of the stream path to be processed by
>> ffmpeg and inversely adding characters within the "" results in less of
>> the
>> stream path being processed by ffmpeg. The characters can be related to
>> any
>> of the commands within the "" and don't need to specifically be any part
>> of
>> the stream paths.
>> To me this looks as if the tee muxer has an undocumented, maximum
>> character
>> input limit for the argument that it takes within the inverted commas.
>> Would any devs or users be able to confirm this based on experience/a
>> deeper knowledge of the code?
> I am afraid you are reaching the 1024 AVFormatContext->filename limit,
> which is unfortunately fixed in ffmpeg/libavcodec.
> Regards,
> Marton

Thanks for that feedback.

Then could you or anyone else think of a way that I can send this already
encoded audio stream to an RTMP ingest server without having to encode it
again? My understanding of ffmpeg is that after the tee muxer statement
none of the mapped and encoded streams will be available to the next output
file. I would need to re-encode the audio stream before sending it off to
the final ingest point. Have I got that wrong?


Kind regards,
Luke Harrison

More information about the ffmpeg-user mailing list