5

I'd like to use a Teradek Cube connected to a broadcast camera to push to a server running ffmpeg with an open RTMP port, and have ffmpeg re-stream that feed to a decoder using RTMP or RTSP.

Monaserver does this, but I need to duplicate this functionality using ffmpeg. I would use the Cube as a server, except it could be broadcasting anywhere so opening ports at every location the camera goes to is not an option. Our decoder is a Teradek Slice. Any other suggestions about how to do this would be greatly appreciated.

Thank you!

1 Answer 1

20

You can use FFmpeg as an RTMP server as following ffmpeg -f flv -listen 1 -i rtmp://localhost:1935/live/app -c copy rtsp://YOUR_RTSP_HOST

Notes:

  • -listen 1 makes FFmpeg act as a RTMP server when used with RTMP protocol
  • Use rtmp://localhost:1935/live/app as the RTMP server url on the source
  • You can set any playpath rtmp://localhost:1935/any/thing and any port
  • The main advantage with this way is simplicity, the disadvantage is server stops if source stopped or had encoding errors
  • The other option is to use nginx with nginx-rtmp-module
10
  • Perfect, thanks a ton. If I'd like to use an application such as VLC to receive the stream from the server, can ffmpeg listen for a connection and output to local port 1935 as well? Commented Mar 18, 2019 at 0:15
  • Yes, ffmpeg -f flv -listen 1 -i rtmp://localhost:8889/live/app -c copy -f flv -listen 1 rtmp://localhost:1935/live/app, just set different ports for input and output
    – Marware
    Commented Mar 18, 2019 at 13:05
  • Thanks again, this is exactly what I need. While testing it I've tried just about every combination of /live/app on the Teradek Cube and various iOS RTMP streaming video apps to test this, and ffmpeg is unresponsive while monaserver works. Is 'app' the key, and does live have to be included in the client's url? Commented Mar 18, 2019 at 18:43
  • 1
    @Marware, is the double -listen 1 in your second comment correct? The second one is being applied to the output URL, so I think it doesn't make sense to start a listening server... Maybe is it just duplicated by copy&pasting the command?
    – Piranna
    Commented Sep 1, 2022 at 6:01
  • 1
    @Piranna Correct, It should be ffmpeg -f flv -i rtmp://localhost:8889/live/app -c copy -f flv -listen 1 rtmp://localhost:1935/live/app
    – Marware
    Commented Sep 1, 2022 at 19:20

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.