docker - 无法在 nginx rtmp 模块上运行 exec
问题描述
我正在使用:arut/nginx-rtmp-server作为 docker 容器。
我使用 HLS 设置了 RTMP 服务器,并且能够通过 HTTP 从 RTMP 流式传输,没有任何问题。但现在我想添加 HLS 变体(用于差异质量 1080p、720p、480 等)。所以我继续将以下代码添加到我的实时应用程序(OBS 的端点)中:
exec ffmpeg -i rtmp://localhost/$app/$name -async 1 -vsync -1
-c:v libx264 -acodec copy -b:v 256k -vf "scale=480:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_low
-c:v libx264 -acodec copy -b:v 768k -vf "scale=720:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_mid
-c:v libx264 -acodec copy -b:v 1024k -vf "scale=960:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_high
-c:v libx264 -acodec copy -b:v 1920k -vf "scale=1280:trunc(ow/a/2)*2" -tune zerolatency -preset veryfast -crf 23 -g 60 -hls_list_size 0 -f flv rtmp://localhost/hls/$name_higher
-c copy -f flv rtmp://localhost/hls/$name_src;
我确实有一个 hls 应用程序并且运行push rtmp://localhost/hls;
正常。
我尝试使用 exec/exec_push/exec_static 因此我认为问题出在 exec 上,因为我添加了几个 bash 脚本来测试它是否确实是 exec 指令的问题,我的脚本都没有运行(但它们确实从我的 shell 运行)
我还user root;
按照另一篇文章中的建议添加到了我的 nginx.conf 的顶部,但这没有用。
我在运行带有 WSL 的 Windows 10 的本地计算机上对此进行了测试,我还尝试在运行 Ubuntu 的私有 VPS 上运行它,但它在那里也不起作用。
解决方案
推荐阅读
- php - MySql 使用 print_r 在页面中仅返回 1 行
- python - 如何打印/显示 telnet 会话的输出并在文件中打印出来 - Python
- regex - 无法增加文件中的内部版本号
- c - 如何使用多个写入器和多个读取器实现 Readers Writers
- c# - XML Serializer 可以,但 Json Serializer 不序列化 Action 方法返回类型
- python - 使用 Python 将公式序列写入 Excel
- c# - ServiceStack 将请求分组在一起
- javascript - 用于收集对象属性、进行批处理并将结果映射回对象的 Javascript 库
- azure - 快速检测 VM 是否在 Azure 上运行
- html - 仅使用 HTML 在中间列中居中内容