[FFmpeg-trac] #10751(ffmpeg:new): FFMPEG hangs randomly

FFmpeg trac at avcodec.org
Wed Dec 20 23:07:18 EET 2023


#10751: FFMPEG hangs randomly
--------------------------------+---------------------------------------
             Reporter:  d4rt    |                     Type:  defect
               Status:  new     |                 Priority:  normal
            Component:  ffmpeg  |                  Version:  unspecified
             Keywords:          |               Blocked By:
             Blocking:          |  Reproduced by developer:  0
Analyzed by developer:  0       |
--------------------------------+---------------------------------------
 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?
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10751>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list