Open chopj opened 9 years ago
FFMPEG does not terminate connection on any unusual condition on RTSP . It does support proper teardown though. And its a known behavior mentioned somewhere on their bug tracker also.
If you want to detect network teardown or stream unavailable and kill FFMPEG on that event then use ffmpeg libraries (libavformat , libavcodec etc) to write your own application and implement a timer based frame counter. If the counter doesn't increment in e-g 30 seconds it means something is wrong and you can exit the process.
I'm having some trouble with hanging ffmpeg proceses started with exec_pull. I'm using exec_static to remux an rtsp source to rtmp via ffmpeg. The incoming rtsp stream is transported over http. The end clients connect via HLS and DASH. We have no rtmp clients.
When we cut network connection from the source, the ffmpeg process still runs. Once the connection is restored, the ffmpeg process doesn't pick up remuxing. However, bouncing nginx (and thus the child ffmpeg) fixes the problem. I realize this isn't likely an nginx problem, but hopefully someone else has had the same issue. How can we automatically restart ffmpeg when detecting an idle stream?
Thanks again. Great software!
Heres the config: