Avconv - Passing a list of image paths

I want to write a script that will generate a timeline video based on a given input of image file paths. I understand that you can do something like this:

avconv -r 15 -i %04d.JPG -s hd480 -vcodec libx264 time-lapse.mp4 

This will search for files in the directory based on the file name template 0000.JPG, 0001.JPG etc. However, I am trying to figure out if there is a way to pass it in the list of file names in the order I want to process? My ideal situation is that I can execute some DB query to get a list of image file paths in chronological order, and then pass them to the avconv command and make it generate video on the fly. I have a specific folder structure for my images, so I would not want to copy the necessary files to the temp directory in order to be able to name them correctly and then process them.

+4
source share
2 answers

This is also the only way to make me work (image2pipe trick doesn't work for me).

  • Create a folder with the images you want in your movie.

  • Rename files (do not forget to backup your images earlier in case of error)

     aa=0;for i in `ls`; do mv $i `printf "%04d" $aa`.png; aa=$(($aa+1));done 
  • Run avconv

     avconv -f image2 -i %04d.png -b 2500k -codec mpeg4 Heligyro.avi 
+1
source

I ended up creating piping ls to create links, and then to create links.

 x=0; for i in $(ls -t *JPG); do counter=$(printf %05d $x); ln -s "$i" "$counter".jpg; x=$(($x+1)); done 
0
source

All Articles