nginx - ffmpeg 和 nginx - 使用音频重新编码重新流式传输

标签 nginx ffmpeg video-streaming

我用 nginxffmpeg从我的提供商重新流式传输视频。以前我在重新编码视频和重新编码音频时使用带有参数的 ffmpeg,因为我的服务器速度很慢,我退出了重新编码。

所以现在,我使用该命令:

ffmpeg -re -i http://link.somelink.com:6565/21d12d1/17233 -map 0 -c copy -bsf:a aac_adtstoasc -f flv -flvflags no_duration_filesize rtmp://test_ip/canal/stream

这仅在我的提供商使用 aac 进行流式传输时才有效。音频编解码器,但有时我的提供商将音频编解码器更改为 ac3 .然后这不起作用。我尝试这样的事情:
ffmpeg -thread_queue_size 32768 -re -i http://link.somelink.com:6565/21d12d1/17233 -c:v copy -c:a aac -f flv -flvflags no_duration_filesize rtmp://test_ip/canal/stream

使用 ffmpeg 在控制台中看起来一切正常,但我的重新流式传输视频不起作用。 Ngnix 有时会抛出 304 异常。

有什么建议么?

请帮忙,
对我来说非常重要...

最佳答案

Ac3 不在支持的编解码器列表中。您应该相应地编码您的流。

RTMP supports only a limited number of codecs. The most popular RTMP video codecs are H264, Sorenson-H263 (aka flv) and audio codecs AAC, MP3, Nellymoser, Speex. If your video is encoded with these codecs (the most common pair is H264/AAC) then you do not need any conversion. Otherwise you need to convert video to one of supported codecs.



https://github.com/arut/nginx-rtmp-module/wiki/Getting-started-with-nginx-rtmp

关于nginx - ffmpeg 和 nginx - 使用音频重新编码重新流式传输,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60965347/

相关文章:

c++ - 单个 RGB 图像的压缩(使用 c++)

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

django - uwsgi协议(protocol)比http协议(protocol)快吗?

nginx - 与 nginx 配置中的位置 block 作斗争

python - 将本地主机 127.0.0.1 添加到 ALLOWED_HOSTS

video - 如何使用 ffmpeg 提取小视频 block ?

batch-file - 我需要脚本来处理所有 dav 文件

c++ - h.264字节流解析

FFmpeg/破折号 : duration or timestamp out of range for mov/mp4 format

ffmpeg - 视频播放列表到 rtmp 服务器使用 ffmpeg 无缝播放,无需重新编码