Opened 5 years ago

Last modified 4 years ago

#7906 new defect

FFMPEG Hangs on dropped connection - RTMP Input

Reported by: adamiss5138 Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: rtmp deadlock
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
I'm streaming from one machine (let's call it FFMPEG_1) to another (FFMPEG_2) through RTMP. If there is a network drop both FFMPEGs hang and do not quit. When network gets up again they quit with error. This is ok. But when connection is lost / dropped and you kill FFMPEG_1, network gets up, FFMPEG_2 will stay hanged forever and will reject any incomming connection.

FFMPEG version does not matter. I've tried 4.1.3 on both machines. Didn't help.

How to reproduce:
FFMPEG_1 - Running on Ubuntu 18.04.1 LTS

% ffmpeg -y -re -i video.mp4 -c copy -c:a aac -ac 2 -ar 44100 -f flv rtmp://
ffmpeg version N-48875-g58d167bcd5-static  Copyright (c) 2000-2019 the FFmpeg developers

built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516

FFMPEG_2 - Running on Windows 10 Build 1809

% ffmpeg -y -timeout 20 -listen 1 -i rtmp:// -c copy -f flv rtmp://nimblestreamer/live
ffmpeg version N-93580-g036b4b0f85 Copyright (c) 2000-2019 the FFmpeg developers

built with gcc 8.3.1 (GCC) 20190414
  • Steps to reproduce
    1. Simulate network connection drop on one machine - does not matter which one (disable network adapter or unplug ethernet cable)
    2. Kill FFMPEG_1
    3. Enable network adapter / plug-in ethernet cable
    4. FFMPEG_2 is now freezed forever and does not accept RTMP input anymore

I'm sorry for my poor English O:)

Change History (3)

comment:1 by adamiss5138, 5 years ago

no response? :/

comment:2 by afedorov, 5 years ago

We are experiencing similar issue, when connection to rtsp server goes down, ffmpeg never comes back alive or quits, regardless of "-stimeout" flag.

Is there a way to configure ffmpeg to exit if connection is down for N milliseconds?

comment:3 by Carl Eugen Hoyos, 4 years ago

Component: ffmpegundetermined
Keywords: deadlock added; input dropped connection hang removed

Is this issue reproducible with current FFmpeg git head?
Please provide the command line you tested together with the complete, uncut console output to make this a valid ticket.

Note: See TracTickets for help on using tickets.