Converting Videos and Creating Timelapse from Photographs in Linux
linux·@makerhacks·
0.000 HBDConverting Videos and Creating Timelapse from Photographs in Linux
https://youtu.be/vHG-LawE9ME I've been building a secure entry and logging system for our new local makerspace, and I realized it would be nice to have a timelapse of all the check ins and check outs. Remembering there is a tool that is related to mplayer, the tool I used for my Tardis, I tried it out. Works out really nice! First get the tool onto your machine: ```sudo apt install mencoder``` Next, we need some parameters: * o - filename to output * oac - copy: copy do not re-encode audio * oac - mp3lame: MP3 with LAME. * ovc - libavcodec (video codec) * ovc:- x264: H.264 codec * lavcopts - MPEG-1 video * of - output container format To convert from one format to another you would do: ```mencoder input.mp4 -o converted.mp4 -ovc x264``` Another example ```mencoder input.mov -o output.avi -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg``` I have found, however, other tools produce more widely compatible files. But that is not the issue today, we want to convert frames into timelapse. Turns out that is easy too: ```mencoder mf://*.JPG -mf fps=5:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi``` You will see something like this: ``` Flushing video frames. Writing index... Writing header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp header. Video stream: 6271.630 kbit/s (783953 B/s) size: 109753533 bytes 140.000 secs 701 frames ``` That's because I didn't set the frame aspect info - not necessary To test it, of course, you can run it through mplayer: ```mplayer output.avi```