【发布时间】:2021-01-07 05:50:59
【问题描述】:
我在欧洲有通过 HLS 流式传输的商业流媒体服务器。
http://europe.server/stream1/index.m3u8
现在我在美国的客户由于距离而遇到一些网络问题。
所以我在美国部署了新服务器。我希望它从欧洲服务器接收 HLS 流并响应美国客户。
所以用户可以访问喜欢
http://usa.server/stream1/index.m3u8
它只会是 H265/HEVC,所以 RTMP 是不可能的。我在网上看到的每个教程都是基于 RTMP 的。
我使用了来自https://docs.peer5.com/guides/setting-up-hls-live-streaming-server-using-nginx/ 的以下配置供参考。
worker_processes auto;
events {
worker_connections 1024;
}
http {
sendfile off;
tcp_nopush on;
aio on;
directio 512;
default_type application/octet-stream;
server {
listen 8080;
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';
# allow CORS preflight requests
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/dash+xml mpd;
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
root /mnt/;
}
}
}
【问题讨论】:
标签: nginx ffmpeg video-streaming streaming http-live-streaming