linux - ffmpeg音视频同步错误

标签 linux ffmpeg pandaboard

./ffmpeg \
-f alsa -async 1 -ac 2 -i hw:2,0 \
-f video4linux2 -vsync 1 -s:v vga -i /dev/video0 \
-acodec aac -b:a 40k \
-r 25 -s:v vga -vcodec libx264 -strict -2 -crf 25 -preset fast -b:v 320K -pass 1 \
-f flv rtmp://192.168.2.105/live/testing

使用上面的命令我能够以 25 的 fps 进行流式传输,但它们没有音频和视频同步,即音频比视频快,我在 pandaboard 上使用 ffmpeg 0.11.1 版本进行 rtmp 流式传输,帮帮我来解决这个问题。

谢谢

阿米思

最佳答案

如果您实际上没有进行二次编码,请不要使用 -pass 1

来自文档(添加了重点):

‘-pass[:stream_specifier] n (output,per-stream)’
Select the pass number (1 or 2). It is used to do two-pass video encoding. The statistics of the video are recorded in the first pass into a log file (see also the option -passlogfile), and in the second pass that log file is used to generate the video at the exact requested bitrate. On pass 1, you may just deactivate audio and set output to null, examples for Windows and Unix:

ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y NUL
ffmpeg -i foo.mov -c:v libxvid -pass 1 -an -f rawvideo -y /dev/null

关于linux - ffmpeg音视频同步错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12684869/

相关文章:

linux - 在 Raspberry Pi 上收集应用程序跟踪

amazon-s3 - 如何在 S3 上构建一个守护进程来编码视频文件?

video - 来自多个文件的 FFmpeg hls

arm - 在 OMAP 4460 上进行多个 DMA 传输时,CPU 是否被阻塞?

c - 使用 seccomp 过滤器获取 "Bad System Call"

python - OpenCV 3.1.0 与 Python 3.5

linux - 如何评估 Linux 中特定命令/docker 的 CPU 和内存使用情况?

android - 如何在 Android 中使用 ffmpeg 合并音频和视频文件?

android - 如何在 Panda board 上移植 Android kitkat?

arm - 如何在不修改主线源代码的情况下添加新的 QEMU 机器类型?