[FFmpeg-user] Maximum argument length for tee pseudo muxer
looxonline
looxonline at gmail.com
Sun Apr 2 11:45:56 EEST 2017
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 at 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-tp4679518p4679676.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.
More information about the ffmpeg-user
mailing list