gpt4 book ai didi

c# - 如何让ffmpeg.exe解决输入帧序列的fps不一致问题?

转载 作者:行者123 更新时间:2023-12-04 23:27:42 33 4
gpt4 key购买 nike

我们现在使用 ffmpeg.exe 将图像序列从 IPCAM 转换为 C# 中的 H.264 视频输出。在这里,我们将 ffmpeg.exe 的输出视频的 fps 设置为 10 帧。但是,来自 IPCAM 的图像序列的 fps 不是固定的。有时超过 10fps,有时低于 10fps。因此,如果我们使用 ffmpeg.exe 录制一小时的数据,录制的视频长度并不精确为一小时。请告诉我们ffmpeg.exe的哪些参数或命令可以使ffmpeg.exe自动解决这种不一致。谢谢你的帮助。

最佳答案

试试这两个命令:

ffmpeg.exe -y -f rawvideo -vcodec rawvideo -s WxH -pix_fmt rgb24 -i \\.\pipe\" + pipename -vsync 0 -r 10 -an -b:v bitrate -vcodec h264_qsv -preset veryslow filename.mkv


ffmpeg.exe -y -f rawvideo -vcodec rawvideo -s WxH -pix_fmt rgb24 -use_wallclock_as_timestamps 1 -i \\.\pipe\" + pipename -vsync 0 -r 10 -an -b:v bitrate -vcodec h264_qsv -preset veryslow -fflags +genpts filename.mkv

不要更改为 MP4 的扩展名。如果上述任何一项工作,我们就可以将 MKV 多路复用到 MP4。
ffmpeg.exe file.mkv -c copy file.mp4

关于c# - 如何让ffmpeg.exe解决输入帧序列的fps不一致问题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36968643/

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