wowza / wirecast / ffmpeg not detecting end of broadcast

Broadcasting Stream A using Wirecast to Wowza.

Broadcasting Stream B using Adobe Flash Media Live encoder to Wowza

using FFMPEG to do some mapping and publishing a third stream to Wowza

ffmpeg -i rtmp://127.0.0.1/live/streamA.sdp -i rtmp://127.0.0.1/live/streamB.sdp -vcodec copy -acodec copy -f flv -map 0:0 -map 1:1 rtmp://127.0.0.1/live/streamC.sdp

This works great, stream C has the audio of B and the video of A. However, if the broadcast stops on Stream A, ffmpeg does not react and continues on encoding. Not sure what it is encoding but wowza must be serving something.

If I reestablish the broadcast for Stream A, stream C never seems to incorporate it again.

What is funny is if Stream A is not started when ffmpeg is going to start, it errors out as expected.

I also tried adding “live=1” to the rtmp input urls. no real change.

Basically the issue is that ffmpeg doesnt seem to react or resume well when these broadcasts start and stop. It doesnt stop encoding, and it doesnt incorporate the changes appropriate to wowza, to the point that resuming the Stream A and B doesnt result in a playable stream C.

Is there a module or something that would send a real kill signal to something like ffmpeg when the broadcast stops or any other suggestion?

I would recommend trying patch1 for Wowza 3.5 as this may help resolve the issue.

It can be found here

https://www.wowza.com/docs/wowza-streaming-engine-software-updates

Andrew.

got the answer from the ffmpeg team which solved the immediate concern adding -shortest to the command line causes it to abort when any of the stream stop. thanks!