Maximum argument length for tee pseudo muxer
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@11' -loglevel debug \ -filter_complex "[0:v]split=2[VID1][VID2];[0:a]channelsplit=channel_layout=stereo[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? -- Kind regards, Luke Harrison
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@11' -loglevel debug \
-filter_complex "[0:v]split=2[VID1][VID2];[0:a]channelsplit=channel_layout=stereo[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
On Wed, Mar 22, 2017 at 11:38 AM, Marton Balint <cus@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@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
Hi All, I thought that I would post this here for the sake of the community and my future self when I inevitably forget how to solve this problem. A colleague and I were discussing this issue and he mentioned that he has used the pipe option to take the output of ffmpeg into another instance of ffmpeg in the past. Any output streams from the first instance that are mapped into the second instance are treated as mappable input streams in the second instance. This would therefore, in theory, allow one to encode an arbitrary number of audio and video streams in the first instance, pipe them to the second instance and then reuse them as many times as needed in the second instance without having to re-encode. They could be stored locally or streamed out. The only caveat is that the "onfail" option available in the tee muxer would not be available with this method so if you are recording and streaming from one machine then your recording runs the risk of failing if the stream goes down. An example of one such use of code is shown below. ffmpeg -threads 0 -f decklink -i 'UltraStudio Mini Recorder@11' -loglevel debug \ -filter_complex "[0:v]split=2[VID1][VID2];[0:a]channelsplit=channel_layout=stereo[AL][AR]" -map '[AL]' -map '[AR]' -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 96k -ar 44100 -async 1 -f nut - 2>> /Users/broadcastingza/logs/"${logdate}".log | \ ffmpeg -f nut -i - \ -map 0:0 -map 0:2 -acodec copy -vcodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath1}${datavid11} \ -map 0:1 -map 0:2 -acodec copy -vcodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath2}${datavid11} \ -map 0:0 -map 0:3 -acodec copy -vcodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath1}${datavid12} \ -map 0:1 -map 0:3 -acodec copy -vcodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath2}${datavid12} \ -map 0:0 -vn -acodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath1}${dataaud11} \ -map 0:1 -vn -acodec copy -f flv -rtmp_flashver "FMLE/3.0(compatible;FMSc/1.0)" -rtmp_live live ${entrypoint}${streampath2}${dataaud11} >> /Users/broadcastingza/logs/"${logdate}".log 2>&1 -- View this message in context: http://www.ffmpeg-archive.org/Maximum-argument-length-for-tee-pseudo-muxer-t... Sent from the FFmpeg-users mailing list archive at Nabble.com.
participants (3)
-
looxonline -
luke harrison -
Marton Balint