Opened 5 months ago
Last modified 5 months ago
#10751 new defect
FFMPEG hangs randomly
Reported by: | d4rt | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | ffmpeg |
Version: | unspecified | Keywords: | |
Cc: | elenril | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
I use ffmpeg (different releases) along with nodejs to stream from my ip camera to youtube. I use the following parameters:
ffmpeg -probesize 5M -analyzeduration 5M -fflags +genpts+igndts+discardcorrupt+ignidx+nobuffer -correct_ts_overflow 0 -r 12 -re -rtsp_transport tcp -i rtsp://xxxxxxxxxxxxxxx -c:v copy -c:a aac -ar 44100 -ac 2 -b:a 128k -bsf:a aac_adtstoasc -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -f flv rtmp://a.rtmp.youtube.com/live2/xxxxxxxxxx
Every now and then ffmpeg freezes and gets stuck on a line e.g.:
frame= 206 fps=9.7 q=-1.0 size= 1432kB time=00:00:21.15 bitrate= 554.4kbits/s speed=0.997x
This happens at random intervals. Sometimes after a couple of hours, sometimes after just a few minutes.
I have a function that periodically checks if the last line in the stdout buffer of the ffmpeg process starts with "frame" and has changed since last check and if it hasn't the process is then killed and restarted. If I didn't restart it within 10-20 seconds my live stream on youtube would end prematurely.
I've tried adding/removing different parameters which didn't help, obviously.
Verbose logs did not give me any answers as to why ffmpeg keeps getting stuck at random. Is there a way I can make ffmpeg detect its being frozen so that it reconnects to the camera automatically?
Both your input and output being network protocols makes this hard to reproduce for me. Could you please try to narrow down testcase, e.g. does is still happen if you
Also, does it still happen with current git master?