I'm using FFmpeg to do restreaming in some streams via HLS.
I use many different type of streams rtmp,rtsp,http,mmsh.
The problem is that sometimes (actually all the time) the ffmpeg hangs in some protocols when the stream is not playable but the FFmpeg pid DOES NOT CLOSE.
For example this happens many times in rtmp protocol. It's not a bug of FFmpeg this is how it works.
The same may happen in http protocol as well when FFmpeg is waiting for input OR when the stream is coming with invalid and small in size bytes. FFmpeg waits for it to being analyze but it fails and hangs.
At first i thought we can solve these problems using I/O timeouts sicne ffmpeg supports it, but that didn't solve anything for the reason i explained above (invalid data are coming).
Currently the only way to check if a ffmpeg is not hanged is to check the HLS playlist (m3u8) if it has been updated using filemtime() in php.
Thank oyu
Aucun commentaire:
Enregistrer un commentaire