我有一个文件夹,里面装满了名称中带有时间戳的帧,格式如下
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/