问题描述
这是我的情况:我想使用Nginx使用HLS通过HTTP服务流。事实是,我希望在收到HLS流的请求时生成/启动它们。
我可以使用RTMP成功实现此行为,因为我具有以下配置文件
application myApp {
live on;
exec_pull myScript.sh $app $name;
exec_kill_signal term;
}
ffmpeg -i sourceLink.m3u8 -codec copy -bsf:a aac_adtstoasc -f flv rtmp://localhost/$APP/$NAME;
这样,当我请求rtmp://myAddress/myApp/someLink
时,它就可以正常工作。
但是,我要流式传输HLS而不是RTMP。我已经看到其他解决方案,可以通过启动RTMP模块并将其推送到HLS应用程序的应用程序来实现。但是,我想要的是,当我接收到对HLS流的请求时,RTMP即会启动(这将启动FFmpeg),并且对流的请求一旦结束,RTMP就会停止接收请求,从而停止FFmpeg。
这是到目前为止我尝试过的配置文件:
application myHLSApp {
live on;
pull rtmp://localhost:1935/myApp/someLink name=test static;
# Turn on HLS
hls on;
hls_path /mnt/hls/;
hls_fragment 3;
hls_playlist_length 60;
# disable consuming the stream from Nginx as rtmp
deny play all;
}
我的主要目标是仅在需要时才在myScript.sh
中启动FFmpeg,然后从我的计算机以HLS格式传输该传入文件。有什么想法吗?
非常感谢您的帮助!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)