powershell - 如何从使用带有 ffmpeg 的时间戳命名的帧创建视频

标签 powershell video ffmpeg mp4 strftime

我有一个文件夹,里面装满了名称中带有时间戳的帧,格式如下

im_%H_%M_%S_%MS.png


im_08_05_09_007324.png
im_08_05_09_532857.png
im_08_05_10_059340.png
im_08_05_10_575862.png
im_08_05_11_118361.png
im_08_05_11_596814.png
im_08_05_12_148340.png
im_08_05_12_665838.png

我尝试使用 -pattern_type glob在 Windows 中,但它不起作用。
ffmpeg.exe -framerate 10 -pattern_type glob -i im_*.png -c:v libx264 -r 30 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"  -pix_fmt yuv420p $videoName

我明白了
 Pattern type 'glob' was selected but globbing is not supported by this libavformat build im_*.png: Function not implemented

后来我发现这在 Windows 上不起作用 :( 这是我正在使用的。ffmpeg Error: Pattern type 'glob' was selected but globbing is not support ed by this libavformat build

我也试试
ffmpeg.exe -framerate 10 -pattern_type glob -i im_%02d_%02d_%02d_%06d.png -c:v libx264 -r 30 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2"  -pix_fmt yuv420p $videoName

我有
im_%02d_%02d_%02d_%06d.png: No such file or directory

我的想法不多了。我拒绝相信在 ffmpeg 和 powershell 中没有办法做到这一点。
我真的很感激任何帮助!

最佳答案

您可以通过 concat demuxer 使用解决方法

按顺序创建具有文件名列表的文本文件

file im_08_05_09_007324.png
file im_08_05_09_532857.png
file im_08_05_10_059340.png
file im_08_05_10_575862.png
file im_08_05_11_118361.png

然后运行
ffmpeg -f concat -r 10 -i list.txt -c:v libx264 ...

(这将产生有关无效 DTS 的警告,但您可以忽略它们)

关于powershell - 如何从使用带有 ffmpeg 的时间戳命名的帧创建视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47935195/

相关文章:

json - 无法在Windows终端中更改Face字体

.net - 如何在 Windows 2012 R2 Core 上的代理后面安装 Chocolatey 软件包?

flash - 将 HTML5 转换为 Flash

audio - Aloha编辑器视频/音频插件

azure - 如何以编程方式将数据写入Azure Blob存储?

powershell - Azure Powershell 脚本返回 "SubscriptionRequestsThrottled"错误消息

python - 如何使用 Moviepy 和 Pygame 播放 mp4 电影

ffmpeg 时间格式 : what does ".80" mean in 00:05:25. 80 for ffmpeg?

perl - 拖尾不断增长的视频文件的最后一帧

macos - ffmpeg调整视频大小使其分辨率错误