使用 ffmpeg 将 rtsp 转换为 rtmp 的正确方法

使用 ffmpeg 将 rtsp 转换为 rtmp 的正确方法

我有一个将 NVR 摄像机流式传输到 YouTube 的代码。此代码不是我编写的,我不完全理解每个选项的作用

ffmpeg -rtsp_transport tcp -i "rtsp://stream:[email protected]:554/cam/realmonitor?channel=2&subtype=0" -tune zerolatency -t 12:00:00 -pix_fmt + -r 30 -c:v copy -c:a aac -filter:a "volume=1.2" -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx

在某些流中,声音会中断并且不稳定。我该如何修复这个问题?此外,我还会定期在输出中看到这样的行:

[aac @ 0xf1b9e880] Queue input is backward in time
[flv @ 0xf1db7800] Non-monotonous DTS in output stream 0:0; previous: 549844, current: 549779; changing to 549844. This may result in incorrect timestamps in the output file.
[flv @ 0xf1db7800] Non-monotonous DTS in output stream 0:0; previous: 549844, current: 549839; changing to 549844. This may result in incorrect timestamps in the output file.
[flv @ 0xf1db7800] Non-monotonous DTS in output stream 0:1; previous: 549754, current: 549671; changing to 549754. This may result in incorrect timestamps in the output file.
[flv @ 0xf1db7800] Non-monotonous DTS in output stream 0:0; previous: 609841, current: 609721; changing to 609841. This may result in incorrect timestamps in the output file.

相关内容