windows 下 nginx-rtmp

283301717 2018-01-19 08:22:32
#user nobody;
worker_processes 1;
error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
rtmp {
server {
listen 1935;
application live {
allow publish all;
allow play all;
live on;
exec_static ffmpeg -i rtsp://admin:12345@192.168.0.64:554/ch1/sub -vcodec libx264 -f flv rtmp://192.168.0.10:1935/hls/mytest;
}
application hls {
live on;
hls on;
hls_path tmp/hls;
hls_fragment 8s;
hls_playlist_length 20s;
hls_continuous on;
hls_cleanup on;
#hls_nested on;

recorder rec { #启用录制
record all manual; #手动控制录制启停
record_suffix _rec.flv;
record_path tmp/rec; #录制保存地址
record_unique on;
}
}
}
}

http {
server {
listen 8100;
location /stat {
rtmp_stat all;
rtmp_stat_stylesheet stat.xsl;
}
location /stat.xsl {
root nginx-rtmp-module;
}

location /control {
rtmp_control all;
}

location /rtmp-publisher {
root nginx-rtmp-module/test;
}

location /hls {
#server hls fragments
types{
application/vnd.apple.mpegurl m3u8;
video/mp2t ts;
}
alias tmp/hls;
#root tmp
expires -1;
add_header Cache-Control no-cache;
}

location / {
root html;
index index.html index.htm index.php;
}
#error_page 404 /404.html;
#redirect server error pages to the static page /50x.html
# error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}

但是运行 nginx.exe exec_static ffmpeg -i rtsp://admin:12345@192.168.0.64:554/ch1/sub -vcodec libx264 -f flv rtmp://192.168.0.10:1935/hls/mytest; 并不会执行,所以也就是说运行nginx.exe 后 rtmp://192.168.0.10:1935/hls/mytest 视频流不存在。

只有直接打开ffmpeg 手动去 ffmpeg -i rtsp://admin:12345@192.168.0.64:554/ch1/sub -vcodec libx264 -f flv rtmp://192.168.0.10:1935/hls/mytest; 才有用。

请告诉解答问题出在哪里?
...全文
379 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,655

社区成员

发帖
与我相关
我的任务
社区描述
Web开发应用服务器相关讨论专区
社区管理员
  • 应用服务器社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧