-1

I am using avconv to convert images into video, but i am facing some issue in it that is. I have thousands of images in a directory and named as video_clip_0_0_0_0_0_0_0_0_09_0_102.jpeg and images did not follow any particular sequence some times add 100 in last field and some times 103(but sure add aprox 100). While using avconv command:

  1. I have to make a temp directory.
  2. Copy all the images into that directory.
  3. convert temp/*.jpeg -delay 10 -morph 10 temp/%05d.jpg.
  4. avconv -f image2 -i temp/%05d.jpeg output.mkv

All this Stuff is taking too much time. I did not want to do all the stuff and want to make video without making any temp directory, or renaming clips etc..For the sake of convenience and save time for the same.

blade19899
  • 26,704

1 Answers1

0

The images have to be in a sequential order in order to create videos In avconv with images. If not it will fail with error message "IMG_%04d.JPG: No such file or directory"

For that you can use the below script to rename the files in sequential order

a=1
for i in *.JPG; do
  new=$(printf "%04d.JPG" ${a}) #04 pad to length of 4
  mv ${i} ${new}
  let a=a+1
done

After renaming the files. you can create videos. You can also give image file range where it can be taken from creating videos using "-start_number"

Note : You will need a recent 9.x version of avconv for the -start_number option; it is not in version 0.8.x. Alternatively you could use a recent version of ffmpeg. Or rename the files to start with a number between 0 and 4, as it will check for those names by default.

BDRSuite
  • 3,156
  • 1
  • 12
  • 11
  • Ya its OK,but issue is- renaming process is taking too much time and i have to make video very quick. Isn’t any way to skip this a Step and make video quick. – Atul Sharma Oct 30 '14 at 09:33
  • You can give try on trkdenlive or ffDiaporama Movie Creator for your requirement – BDRSuite Oct 30 '14 at 10:14