0

I'm running this command on my Android phone with an FFmpeg library. It works great for combining videos into one resultant video, but not with images. Here's the command:

 -framerate 4 -start_number 0 -i '/storage/emulated/0/Pictures/phototest/%3d.jpg' -c:v libx264 -r 30 -pix_fmt yuv420p /storage/emulated/0/Pictures/phototest/result.mp4 

The error is:

'/storage/emulated/0/Pictures/phototest/%3d.jpg': No such file or directory 

The images are just consecutively named, e.g. 1.jpg, 2.jpg and so on, and they're definitely there - though I think FFMPEG is taking the image file name literally rather than interpreting it. I'm missing something obvious here, I'm sure of it. I looked round StackOverflow and the whole '%3d' wildcard is supposed to work! Any ideas?

EDIT: Running the command with just the first image (1.jpg) works fine. Definitely an issue with the wildcard. In addition, running the command without the image path in quotes doesn't seem to work either.

EDIT 2: Adding 'img' in front of every file so that it it's 'img1.jpg', 'img2.jpg' and so on doesn't work either. Is there a way to pass multiple images separated by '|' like the concat command?

2 Answers 2

2

If your filenames are 1.jpg, 2.jpg, 3.jpg, ...

then you have to use

'/storage/emulated/0/Pictures/phototest/%d.jpg' 

If your filenames are img1.jpg, img2.jpg, img3.jpg, ...

then you have to use

'/storage/emulated/0/Pictures/phototest/img%d.jpg' 

If your filenames are img01.jpg, img02.jpg, img03.jpg, ...

then you have to use

'/storage/emulated/0/Pictures/phototest/img%02d.jpg' 

If your filenames are img001.jpg, img002.jpg, img003.jpg, ...

then you have to use

'/storage/emulated/0/Pictures/phototest/img%03d.jpg' 

For more details refer this https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/image_sequence

Sign up to request clarification or add additional context in comments.

Comments

1

I figured it out. %3d actually is equal to 01, 02, 03, etc. So taking the 3 away for just '%d' worked fine.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.