RTMP server using ffmpeg - Video Production Stack Exchangemost recent 30 from video.stackexchange.com2019-09-15T12:48:03Zhttps://video.stackexchange.com/feeds/question/26257https://creativecommons.org/licenses/by-sa/4.0/rdfhttps://video.stackexchange.com/q/262571RTMP server using ffmpegPandazoichttps://video.stackexchange.com/users/238902019-03-17T22:59:23Z2019-03-18T13:04:11Z
<p>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.</p>
<p>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.</p>
<p>Thank you!</p>
https://video.stackexchange.com/questions/26257/-/26258#262584Answer by Marware for RTMP server using ffmpegMarwarehttps://video.stackexchange.com/users/159862019-03-18T00:09:04Z2019-03-18T13:04:11Z<p>You can use FFmpeg as an RTMP server as following
<code>ffmpeg -f flv -listen 1 -i rtmp://localhost:1935/live/app -c copy rtsp://YOUR_RTSP_HOST</code></p>
<p>Notes:</p>
<ul>
<li><code>-listen 1</code> makes FFmpeg act as a RTMP server when used with RTMP protocol</li>
<li>Use <code>rtmp://localhost:1935/live/app</code> as the RTMP server url on the source </li>
<li>You can set any playpath <code>rtmp://localhost:1935/any/thing</code> and any port</li>
<li>The main advantage with this way is simplicity, the disadvantage is server stops if source stopped or had encoding errors</li>
<li>The other option is to use nginx with <a href="https://github.com/arut/nginx-rtmp-module" rel="nofollow noreferrer">nginx-rtmp-module</a></li>
</ul>