I have an FFMPEG command which was able to send an RTMP live feed to 2 different icecast radio stations:
command 1 (in prod; 1 of 2 failing):
/home/ubuntu/encoder/bin/ffmpeg -i rtmp://127.0.0.1:1935/app/live -vn -c:a mp3 -ac 2 -b:a 64k -ar 44100 -f tee -map 0 "[f=mp3:onfail=ignore]icecast://source:password@liquidsoap:8000/live|[f=mp3:onfail=ignore]icecast://source:[email protected]:80/live"
I would get the following FFMPEG error when running above command 1:
[tee @ 0x562fffd24bc0] Slave '[f=mp3:onfail=ignore]icecast://source:[email protected]:80/live': error opening: End of file
[tee @ 0x562fffd24bc0] Slave muxer #1 failed: End of file, continuing with 1/2 slaves.
It was working fine until these days when one of them (fluoz.zeno.fm:80/live) stopped working and I think Zeno upgraded their Icecast servers from v1 (legacy) to v2. Why? because when I was doing individual testing to the Zeno icecast server, I realized that it worked fine when I added the -legacy_icecast 1 option
command 2 (testing to Zeno only w/ -legacy_icecast 1 option):
/home/ubuntu/encoder/bin/ffmpeg -i rtmp://127.0.0.1:1935/app/live -vn -c:a mp3 -ac 2 -b:a 64k -ar 44100 -legacy_icecast 1 -f mp3 icecast://source:[email protected]:80/live
QUESTION:
How can I use the command 1 above to still send to both icecast servers but having the -legacy_icecast 1 option to only affect the zeno icecast server and not the liquidsoap icecast server? I want to avoid running 2 separate instances of ffmpeg at all cost in order to save system resources and bandwidth.
The reason I ask this question is because I tried adding the -legacy_icecast 1 option to the command 1 (that one that sends to both) by placing it right before the ...-f tee... option, but it still didn't work to send to Zeno icecast server which failed (the liquidsoap icecast server kept running fine). It seems to only work fine when I use command 2 (above) when not using the tee muxer option.
Is there a tricky way to place that -legacy_icecast 1 option within the tee muxer option??