I have to make a semi-live-stream. I used Nginx-rtmp module and then pushed content to it via ffmpeg using:
ffmpeg -re -i content.mp4 -r 25 -f fvl \"rtmp://rtmp.
RTMP protocol usage is very limited and primarily being used for video recording. There is no reason to use it for playback as mobile devices don't support RTMP natively, you don't think it can be a good idea to advice mobile users to install VLC or similar app on the device?
Plugin nginx-rtmp-module has been incorporated to Nginx+ to make a comprehensive recording media server out of Nginx as a replacement to Wowza Media Server or implement HLS for playaback via HTTP. This plugin can be used with Nginx open source edition.
To make your video content available to mobile devices you have only 2 options, each of them work via HTTP(s), not RTMP:
HTTP Live Streaming, see the example:
location / {
hls;
hls_fragment 5s;
hls_buffers 10 10m;
hls_mp4_buffer_size 1m;
hls_mp4_max_buffer_size 5m;
root /var/video/;
}
HTTP pseudo streaming, see the example
location /video/ {
mp4;
mp4_buffer_size 1m;
mp4_max_buffer_size 5m;
mp4_limit_rate on;
mp4_limit_rate_after 30s;
}
The other side is security. How to protect the video streaming URL? Pre-generated time-expired URLs is good approach, you can try, see my example there.