[英]Nginx RTMP module to generate HLS
I'm streaming an audio stream with opus codec from Kurento via ffmpeg to nginx-rtmp-module.我正在通过 ffmpeg 将带有 opus 编解码器的音频流从 Kurento 流式传输到 nginx-rtmp-module。 I'm using the below command to stream to nginx-rtmp:
我正在使用以下命令流式传输到 nginx-rtmp:
ffmpeg -protocol_whitelist file,udp,rtp -i test-audio.sdp
-c:a libopus -f opus rtmp://<server_ip>/live/<stream_name>
I see no error on the ffmpeg side.我在 ffmpeg 方面没有看到错误。 But there's no m3u8 file being generated.
但是没有生成 m3u8 文件。 But I noticed the following in the nginx log:
但是我在 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
Noticed the acodes=0
.注意到
acodes=0
。 Does this mean that it doesn't like opus codec?这是否意味着它不喜欢 opus 编解码器?
Below is my nginx.conf:下面是我的 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;
}
}
}
Thanks for any help.谢谢你的帮助。
Found out why it is not working.找出它不工作的原因。 The correct command should be
正确的命令应该是
ffmpeg -protocol_whitelist file,udp,rtp -i test-audio.sdp
-c:a aac -f flv rtmp://<server_ip>/live/<stream_name>
I was missing the -f flv
and also flash doesn't like opus either, I needed to specify aac
instead.我错过了
-f flv
并且 flash 也不喜欢 opus,我需要指定aac
来代替。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.