gpt4 book ai didi

linux - ffmpeg音视频同步错误

转载 作者:太空宇宙 更新时间:2023-11-04 11:28:41 24 4
gpt4 key购买 nike

./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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com