Im trying to convert rtmp into an HLS stream using ffmpeg as the rtmp server. In the docs they mention that providing -listen 1 makes ffmpeg act as an rtmp server yet the behaviour is very weird.

Example's I've tried (hls part changed to mp4 for readability):

ffmpeg -listen 1 -f flv -i rtmp://localhost:1935/live/appname -c copy -f mp4
ffmpeg -listen 1 -f mpegts -i rtmp://localhost:1935/live/appname -c copy -f mp4

All give me the following error:

RTMP_Connect0, failed to connect socket. 61 (Connection refused)
rtmp:// Unknown error occurred

What does work for me is when I change rtmp into tcp and vice versa in OBS for a test stream; however I actually doubt its then using rtmp as its underlying protocol.

Are there certain flags I have to enable during compilation of ffmpeg? My version has librtmp enabled. I'm not entirely sure what I'm doing wrong here but it looks like ffmpeg is still going into client mode even though I specified the listen flag.

Some other details: I have tried with different outputs as well; with no luck, different placements of listen etc.

1 Answer 1


Try to use static build of ffmpeg without librtmp. You can download it from the website, or build by yourself. I've got the same problem, but without this lib I could run ffmpeg listener. Also when I tried to stream to external rtmp host, I've got issue when streaming unexpectedly stop. As described in the end of this ticket https://trac.ffmpeg.org/ticket/7547

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.