ffmpeg img to video = Could find no file with path

我的梦境 提交于 2020-11-28 07:44:28

问题


i try to convert img to mp4 with ffmpeg. i try to do it like this:

ffmpeg -framerate 25 -f image2 -start_number 1 -i '/tmp/stream/_%09d.jpg' -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p output.mp4

and get an error:

[image2 @ 0xe74800] Could find no file with path '/tmp/stream/_%09d.jpg' and index in the range 1-5
/tmp/stream/_%09d.jpg: No such file or directory

The jpg file-name format is:

/tmp/stream/2017_11_20_08_48_30_picture_000000001.jpg
/tmp/stream/2017_11_20_08_48_35_picture_000000002.jpg
/tmp/stream/2017_11_20_08_48_40_picture_000000003.jpg
***
/tmp/stream/2017_11_20_08_56_30_picture_000000999.jpg

anyone can help, where is mistake?... Thanks!


回答1:


To match all jpg files in /tmp/stream use:

ffmpeg -framerate 25 -pattern_type glob -i '*.jpg'

For more specificity use additional glob patterns. For example, if you only want images from 2017-11-08 to 2017-11-10:

ffmpeg -framerate 25 -pattern_type glob -i '/tmp/stream/2017_11_{08,09,10}*.jpg'

For more info on glob patterns see man 7 glob.




回答2:


_%09d.jpg matches names of the form _000000001.jpg, _000000002.jpg

Use -pattern_type glob -i '/tmp/stream/*_%09d.jpg'



来源:https://stackoverflow.com/questions/47389201/ffmpeg-img-to-video-could-find-no-file-with-path

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!