Answer the question
In order to leave comments, you need to log in
How to setup video streaming through NGINX using ffmpeg for HTML5?
Trying to set up nginx with nginx-rtmp-module
rtmp {
server {
listen 1935;
chunk_size 4000;
application dash
{
live on;
dash on;
dash_nested on;
dash_path /mnt/dash;
dash_fragment 3;
dash_playlist_length 120;
dash_cleanup on;
record off;
}
application hls
{
live on;
hls on;
hls_path /mnt/hls/;
hls_fragment 3;
hls_playlist_length 60;
}
}
}
http {
sendfile off;
tcp_nopush on;
aio on;
directio 512;
default_type application/octet-stream;
server
{
listen 8080;
location /dash
{
root /mnt/;
add_header Cache-Control no-cache;
}
location /hls
{
add_header Cache-Control no-cache;
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length';
if ($request_method = 'OPTIONS')
{
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain charset=UTF-8';
add_header 'Content-Length' 0;
return 204;
}
types
{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /mnt/;
}
}
}
ffmpeg -i "rtmp://..." -c:v libx264 -profile:v baseline -c:a aac -strict -2 -f flv "rtmp://127.0.0.1/dash/stream"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question