如果你能给我一点启示,我会很感激的。
所以,基本上,我从我的编码器拉一个流,它工作,我得到的m3u8输出,它是可访问的,但HLS视频是不稳定的,我失去了帧。这出戏不连续。
2017/06/12 16:04:09 [error] 1281#0: *58 hls: force fragment split: 10.002 sec(编辑后从RTSP.) 2017/06/13 10:48:55错误1281#0:*763 hls:强制片段拆分: 10.416秒,客户端: XX,服务器:0.0.0:1935年
下面是我的配置文件:
#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/;
}
}
}发布于 2017-06-15 17:33:31
**好吧。我有新消息。基本上,这种配置是完美的。我丢失所有这些包的原因是编码器和专用服务器之间的距离。
建议在编码器所在的地方让服务器.所以,这对我有用。
干杯**
https://stackoverflow.com/questions/44510164
复制相似问题