2

mencoder and ffmpeg are no longer included in the Raspbian repositories since Jessie was released. mencoder was previously used in an RPi Foundation tutorial here to compile a timelapse video.

I've seen that avconv can be used to do the same thing, and it is included in Raspbian Jessie, but what command should I use for that?

My folder of stills looks like this:

photo1.jpg  photo2.jpg  photo3.jpg  photo4.jpg  photo5.jpg
photo6.jpg  photo7.jpg  photo8.jpg  photo9.jpg   photo10.jpg
...

The previous command looked like this:

ls *.jpg > stills.txt; mencoder -nosound -ovc lavc -lavcopts vcodec=mpeg4:aspect=16/9:vbitrate=8000000 -vf scale=1920:1080 -o timelapse.avi -mf type=jpeg:fps=24 mf://@stills.txt

How could I do this with avconv or another command that is supported in Raspbian Jessie?

2

There's a reasonably simple approach given at techedemic.com:

Name all image files sequentially.

avconv can (apparently - I haven't checked) require names with a leading string followed by 0000/0001/0002/etc. Convert your file names using:

ls *.JPG| awk 'BEGIN{ a=0 }{ printf "mv %s myfile%04d.JPG\n", $0, a++ }' | bash

With everything renamed, use the following command to create a clip with the original resolution, and at high quality:

avconv -y -r 10 -i myfile%4d.JPG -r 10 -vcodec libx264 -q:v 3  -vf crop=4256:2832,scale=iw:ih tlfullhiqual.mp4;

Explanation:

-y forces avconv to overwrite any file

-r 10 creates a clip with 10 frames per seconds (for some versions of avconv you have to specify it twice)

-i specifies the input file(s). %4d means any 4 decimal numbers

-vcodec specifies the video codec to be used (H.264 in this case)

-q:v specifies the quality, value ranges from 1 (best) to 31 (worse)

crop= specifies which area of the images will be cropped

scale= indicates how much scaling must take place (in the above example iw:ih indicates that the output width and height will be that of the in width and in height)

the last parameter is the output file

0

Another alternative for viewing stills as a movie is to use VidMyFigs.com, which allows you to view the resulting "movie" in any javascript-enabled Web browser.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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