FFmpeg 延迟超过 3 秒(必须是亚秒级)

标签 ffmpeg raspberry-pi

我正在开发一个可以从任何地方访问的机器人(基于树莓派 4)。我的机器人目前处于 3 秒延迟。我还使用 OvenMediaEngine(RTMP 到 WebRTC)将我的流传输到客户端(在网站上)。这是我的命令:
raspivid -n -t 0 -w 1280 -h 720 -fps 25 -b 3500000 -g 50 -fl -o - | ffmpeg -thread_queue_size 1024 -i - -itsoffset 6 -f alsa -channels 1 -thread_queue_size 1024 -i hw:2 -preset ultrafast -tune zerolatency -vcodec libx264 -r 25 -b:v 512k -s 1280x720 -acodec aac -ac 2 -ab 32k -ar 44100 -f flv rtmp://xxxxxxxx:1935/app/stream
有谁知道为什么它不会以亚秒级延迟流式传输?
提前致谢!

最佳答案

我不确定您在哪里产生延迟,但它通常发生在传输或编码期间。
如果可能的话,我会看看你是否避免重新编码为 H264。您将支付解码(或只是解析?)然后编码的惩罚。
我还想看看你是否可以用 RTMP 以外的东西摄取到 OME。 WebRTC 和 RTSP 都会给你更好的延迟。

关于FFmpeg 延迟超过 3 秒(必须是亚秒级),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70690235/

相关文章:

javascript - 将命令行输入转换为 Node Fluent ffmpeg

image - FFmpeg : I'm looking for a way to put some blur behind the image by cutting it

python - 由于 "TypeError: unhashable type: ' bytearray'"(在树莓派中)导致消息被截断

java - 无法从 Raspberry Pi 获得 REST 响应

c - 尝试在 RPI - TSL2561 上使用 i2c 和 bcm2835 读取光传感器

python - 在 Python 中放置变量

python - 为什么我不能在 Raspberry Pi 上使用 python-mosquitto?

networking - 为什么无法从同一网络中的另一台电脑接收 rtp 流?

c++ - 由于库的包含语句,无法通过 GCC 编译使用库 (FFmpeg) 的 C 程序

php - 如何使用 php 和 ffmpeg 将歌曲剪切到前 30 秒