我有一个包含一些图像路径的文本文件(图像在文本文件中按顺序排列),文件如下所示:
/home/Recording-Session-1456734351095_images/output_0001.png
/home/Recording-Session-1456734351095_images/output_0002.png
/home/annotations/rec_1456734351095/annotated_output_0003.png
.......
我想使用
ffmpeg
从这些图像创建视频。这是我正在使用的命令:ffmpeg -framerate 20 -f image2 -i images.txt -c:v libx264 -r 20 -pix_fmt yuv420p out.mp4
但它给了我这个错误:
[image2 @ 0x32ce7a0] Could not find codec parameters for stream 0 (Video: none, none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
我为
analyzeduration
和 probesize
尝试了不同的数字,但错误仍然存在,知道是什么问题吗?
最佳答案
图像解复用器不将文本文件作为输入。您可以使用 concat demuxer 或将图像收集在一个文件夹中并连续命名。
使用 concat 解复用器,
ffmpeg -r 20 -f concat -i images.txt -c:v libx264 -pix_fmt yuv420p out.mp4
或使用 image2
ffmpeg -framerate 20 -i /home/Recording-Session-1456734351095_images/output_%04d.png -c:v libx264 -r 20 -pix_fmt yuv420p out.mp4
最好是后者。
关于ffmpeg - 使用 FFMPEG 从图像列表创建视频时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38730676/