1

I want to combine all these .bmp files into one movie.mp4.I am using ffmpeg.

bmp files

This command produces a movie of only 0.04 seconds:

$ ffmpeg -i f%05d.bmp -c:v libx264 -r 30 -pix_fmt yuv420p movie.mp4

It should pick all the files up no? I don't know what I am doing wrong and can't find a solution.

This command I tried from here says it can't find file with path 'f%05d.bmp' even though the above command can?

$ ffmpeg -r 60 -f image2 -s 1920x1080 -start_number 1 -i f%05d.bmp -vframes 1759 -vcodec libx264 -crf 25  -pix_fmt yuv420p test.mp4
2
  • Answer depends on your OS.
    – llogan
    Aug 16, 2020 at 18:46
  • 1
    "It should pick all the files up, no?" - As mentioned in one of the answers below, regardless of anything else, you likely need to make your frames sequential, without any gaps in the numbering (e.g. no f69400 skipping to f69440 as the next frame, just ex. f00001, f00002, f00003, etc.). Aug 17, 2020 at 5:56

2 Answers 2

2

I think files should have consecutive numbers, otherwise they are treated separately (hence you get a 0.04 sec movie - just one frame). Few days ago I needed something similar (although not for ffmpeg but to import files into DaVinci Resolve) and I wrote a simple python script:

import os

filename="whatever{0:05d}.png"
destno = 1

for i in range(0, 10000):
   src = filename.format(i)
   if os.path.isfile(src):
      dst=filename.format(destno)
      destno+=1
      os.rename(src, dst)
      print "renamed {0:s} to {1:s}".format(src, dst)

Lousy, but worked.

0

Maybe you could change the globbing to get all the .bmp files:

ffmpeg -r 60 -f image2 -s 1920x1080 -start_number 1 -i %*.bmp -vframes 1759 -vcodec libx264 -crf 25  -pix_fmt yuv420p test.mp4
4
  • I get a " Could find no file with path '%*.bmp' and index in the range 0-4 %*.bmp: No such file or directory" error. Aug 16, 2020 at 17:05
  • Then first cd to the directory where files are
    – Wasif
    Aug 16, 2020 at 17:08
  • Also you can't use -f with -c:copy (Codec copy)
    – Wasif
    Aug 16, 2020 at 17:11
  • -f and codec copy have no limitation with respect to each other.
    – Gyan
    Aug 16, 2020 at 17:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .