If you could shed some light for me i would appreciate it.
So, basically i am pulling a stream from my encoder and it works, i get the m3u8 output and it is accesible but the HLS video is jumpy and i lose frames. the play is not continuous.
2017/06/12 16:04:09 [error] 1281#0: *58 hls: force fragment split: 10.002 sec
(Edit after pulling from RTSP...) 2017/06/13 10:48:55 [error] 1281#0: *763 hls: force fragment split: 10.416 sec, , client: XX, server: 0.0.0.0:1935
Here is my config file:
#user nobody;
worker_processes 1;
events {
worker_connections 1024;
}
# RTMP configuration
rtmp {
server {
listen 1935; # Listen on standard RTMP port
chunk_size 4000;
application live {
live on;
exec_pull ffmpeg -re -i rtsp://xxx/xxx -c copy -f flv rtmp://xxx:1935/live/xxx;
exec_pull ffmpeg -re -i rtsp://xxx:8080/xxx -c copy -f flv rtmp://xxx:1935/live/xxx;
# Turn on HLS
hls on;
hls_path /tmp/hls/;
hls_fragment 3;
hls_playlist_length 60;
}
}
}
http {
sendfile off;
tcp_nopush on;
directio 512;
default_type application/octet-stream;
server {
listen 80;
server_name localhost;
# rtmp statistics
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
# you can move stat.xsl to a different location
# under linux you could use /var/user/www for example
root html;
}
location / {
# Disable cache
add_header 'Cache-Control' 'no-cache';
# CORS setup
add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
add_header 'Access-Control-Allow-Headers' 'Range';
# allow CORS preflight requests
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Headers' 'Range';
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/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /tmp/;
}
}
}
**OK So.. i have news. Basically that configuration was perfect. The reason why i was losing all these packages was because of the distance between the encoder and the dedicated server.
Advised to have the server locally where the encoders are... So, that for me worked.
Cheers**