0

I know this is with great possibility a duplicate of same questions, but I dont get it working. So how can I under windows generate a mp4 video with h265 codec and 30fps of a bunch of images.

What I have done so far is to try this answers from this post:

Duplicate Question

If I try this:

 C:\\ffmpeg-3.4.2-win64-static\\bin\\ffmpeg -r 1/5 -i img%%03d.jpg -c:v libx264 -vf fps=25 -pix_fmt yuv420p out.mp4

I get the following output:

img%%03d.jpg: No such file or directory

I got filename like this:

img0001.jpg / img0002.jpg until img0030.jpg

So maybe I got the filename syntax wrong - I just dont know...

I have also tried this command:

C:\\ffmpeg-3.4.2-win64-static\\bin\\ffmpeg -framerate 29 -pattern_type glob -i img%%03d.jpg -c:v libx265 -crf 28 -c:a aac -b:a 128k output.mp4

but I get the same error..

Please help me I am not really into this ffmpeg stuff and need advice!

Maybe you can also show me how to set a directory of images in the ffmpeg params.

Thank you and greets!

2 Answers 2

1

Use

ffmpeg -framerate 30 -i "img%04d.jpg" -c:v libx265 -crf 28 output.mp4

Since your numbering has four digits (0001..), you need %04d.

Depending on how you're executing this command, you may need to escape the %

-pattern_type glob applies for wildcard matching, but your filename template is a smoothly numbered sequence so it's incorrect in this context.

5
  • Your command did the job! Thanks man! Just changing 03d to 04d didnt the job, I also had to remove -patter_type glob.. Thanks man! Aug 15, 2018 at 10:07
  • Is there an option to give ffmpeg a param with original bitrate? Not just -crf 0 -51 stages? Aug 15, 2018 at 10:11
  • Original bitrate? If you just mean a target bitrate - then use -b:v VALUE and drop the crf.
    – Gyan
    Aug 15, 2018 at 10:44
  • I have an input video that I modify in specific frames and now I just want to write it back in orign qualitiy with same values just as input bitrate... I will -b:v VALUE give a try! Let me ask one more question please - is this the best approach to generate a video from a modified input video? I really appreciate your help! Thanks Aug 15, 2018 at 10:57
  • The original bitrate is a red herring in video recompression with modern encoders. A low enough CRF value - arrived at by subjective evaluation or by use of video quality measurement filters like SSIM - is the way to go. Unless you perform truly lossless encoding, all re-encoding will cause some generational loss, which is OK. The whole point of modern video codecs is that not all data is perceptually important so they are designed to disregard the data which isn't and keep that which is.
    – Gyan
    Aug 15, 2018 at 11:07
0

You need to use img%%04d.jpg instead of img%%03d.jpg, because your filenames contain 4 digits.

1
  • If I could vote with my rank I would, because this change is also neccessary! Thanks! If I level up and remeber I will come back. Aug 15, 2018 at 10:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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