Nginx RTMP模块生成HLS

标签 nginx ffmpeg rtmp hlsl opus

我正在使用来自 Kurento 的 opus 编解码器流式传输音频流
通过 ffmpeg 到 nginx-rtmp-module。我正在使用以下命令流式传输到 nginx-rtmp:

ffmpeg -protocol_whitelist file,udp,rtp  -i test-audio.sdp  
-c:a libopus  -f opus rtmp://<server_ip>/live/<stream_name>
我在 ffmpeg 方面没有看到任何错误。但是没有生成 m3u8 文件。但我在 nginx 日志中注意到以下内容:
2020/11/23 23:19:31 [info] 95#0: *8 connect: app='live' args='' flashver='FMLE/3.0 (compatible; Lavf57.83' swf_url='' tc_url='rtmp://192.168.4.28:1935/live' page_url='' acodecs=0 vcodecs=0 object_encoding=0, client: 172.17.0.1, server: 0.0.0.0:1935
注意到 acodes=0 .这是否意味着它不喜欢 opus 编解码器?
下面是我的 nginx.conf:
rtmp {
    server {
        listen 1935;
        chunk_size 4096;
        application hopefm {
            live on;
            interleave on;

            hls on;
            hls_path /mnt/hls;
            hls_fragment 3;
            hls_playlist_length 60;
        }
    }
}
谢谢你的帮助。

最佳答案

找出为什么它不起作用。正确的命令应该是

ffmpeg -protocol_whitelist file,udp,rtp  -i test-audio.sdp  
-c:a aac  -f flv rtmp://<server_ip>/live/<stream_name>
我错过了 -f flv而且 flash 也不喜欢 opus,我需要指定 aac反而。

关于Nginx RTMP模块生成HLS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64980069/

相关文章:

node.js - Nginx 为 WebSockets 处理 SSL

image-processing - 防止ffmpeg在降低视频分辨率的同时改变颜色的强度

ffmpeg - 使用 ffmpeg 打开 RTMP 文件时崩溃

java - Red5 RTMP 流媒体

Android:如何将 rtmp 流地址发送到外部视频播放器(例如 MX 播放器)

redirect - 用于查询字符串的Nginx位置正则表达式

nginx - 通过Jwilder的Nginx代理访问虚拟主机时出现502错误网关

ffmpeg - 如何使用 FFMPEG 生成立体声正弦波?

ffmpeg libx264 : whats the difference between crf and profile and preset in terms of quality (bitrate)

php - nginx配置问题,端口已被使用