Tell me more ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have all of these images as jpegs and I want to stream them into an AVI. I am trying to use ffmpeg with the command noted here but I get an error "No such file or directory".

My exact command is (from the folder containing all of these files):

ffmpeg -f image2 -i frame_%d.jpg view.avi

How do I do this? Also, how can I do this for a specific range of images? Say I only want frames 500 to 1000, so I want frame_0500.jpg to frame_1000.jpg?

share|improve this question
If you were doing it one by one, does it work (thinking of a workaround)? – soandos Dec 22 '11 at 4:11
It might not be working because it is looking for frame_1, and you have frame_0001. – soandos Dec 22 '11 at 4:13
I think that is the reason, you're correct :) But there's no way I'm renaming thousands of files to remove those zeros. There must be a way ffmpeg can handle this? – water Dec 22 '11 at 4:13
You can rename the files with Bulk Renamer but I don't think there is a way to do it without that – soandos Dec 22 '11 at 4:20
You can use frame_%04d.jpg to correctly handle the leading zeros but ffmpeg will still insist the sequence start at 0001. To start are 0500 I think you'll need to bulk rename. – Mike Fitzpatrick Dec 22 '11 at 4:23

2 Answers

up vote 1 down vote accepted

The correct command should be

ffmpeg -f image2 -i frame_%04d.jpg view.avi

The %04d means the number is 4 characters in length, zero padded (0000-9999).

If you want to do a range, I would just move the files you want into their own directory.

This is easy with a gui, but with command line you could do

mv frame_0[5-9]* newfolder
mv frame_1000* newfolder
share|improve this answer

In addition to Paul's suggestion you can often use cat to pipe your images to ffmpeg:

cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output

Note that you may have to change c:v to vcodec depending on how old your ffmpeg is. This is useful if your images are sequentially ordered but not in a method that ffmpeg accepts (such as images not starting with 1).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.