I have an rtsp stream that is published to rtmp using ffmpeg. The same ffmpeg process also saves the files locally as mp4.
Nginx has been set up to receive the rtmp stream and publish as HLS
This sometimes works...however more commonly the HLS output is a pulsing green square.....
Any ideas?
ffmpeg -rtsp_transport tcp -t 1800 -i rtsp://<rtsp_string> -vcodec copy -an -strict -2 -f flv rtmp://localhost/main_door/stream -map 0 -vcodec copy -an -movflags +faststart -f mp4 /tmp/clip.mp4
The rtsp stream is at ~800Kbps, 1080p
nginx v1.18.0
load_module "modules/ngx_rtmp_module.so";
load_module "modules/ngx_http_fancyindex_module.so";
worker_processes 1;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;
application main_door {
live on;
hls on;
hls_path /mnt/hls/;
hls_fragment 3;
hls_playlist_length 60;
deny play all;
}
}
}
http {
index index.html index.htm index.php;
include /etc/nginx/mime.types;
server {
listen 8080;
location / {
fancyindex on;
fancyindex_localtime on;
fancyindex_exact_size off;
add_header 'Cache-Control' 'no-cache';
root /mnt/;
}
}
}