Convert Still Photos to a GIF or Video

smallWalk

Really just a technical note for myself. I thought I had written this down somewhere here, but I couldn’t find it, so, here it is.

Converting png to a video in Linux:

ffmpeg -framerate 24 -pattern_type glob -i ‘*.png’ -c:v libx264 -r 30 -pix_fmt yuv420p out.mp4

Setting the framerate sets the speed of the video. You can replace png with jpeg or jpg if needed. This does, of course, require the ffmpeg utility/package.

And, converting png to a GIF in Linux:

convert -delay 10 -loop 0 *.png myimage10.gif

The delay sets the milliseconds of delay between frame, so lower makes a faster video, higher makes a slower video. 8 to 10 seems about right for something that should look “real time”. This requires the imagemagick package.

Linux – keep it simple.

Merging Two MP4 Files From The Command Line

term

One of the problems I find with video editing, is sometimes it becomes very complicated to do something very simple. Take my current need. I needed to simply tie two mp4 files together, unedited, just hook one to the next. There are lots of gui types, but that requires opening them up, adjusting settings, loading or importing the files, and just a little more time and work than I want for such a simple task.

Fortunately, I found a really easy to use method to do that from the command line: MP4Box!

You can install it like so:

$ sudo apt-get install gpac

$ sudo ln -s /usr/local/lib64/libgpac.so /usr/lib/libgpac.so

Once installed, it is very, very simple to use:

 

$ MP4Box -cat myFirstVideo.mp4 -cat mySecondVideo.mp4 -new myNewVideoFile.mp4

That’s it! Now, whenever I need to add two videos together, all I have to do is run one simple command, and in seconds, it is done! That’s what I like to call simple!

Linux – keep it simple.

Video Editing on Linux

I’ve been putting together a video series about how to compile custom Android Roms and Kernels. Of course, I’m doing it all from my Linux box, and it’s really pretty easy with the great tools available.

I used RecordMyDesktop to record the screen while performing the work. When I needed to redo the audio, or change it, I made new audio recordings with Gnome Sound Recorder, and have been splicing everything together with PiTiVi.

PiTiVi

All of these tools are very simple to learn and use, and PiTiVi is really incredible for cutting and pasting different video clips together! When I’m done, I “render” or build the final product as an ogg-vorbis video.

However, some of the people who would like to use the videos don’t have an ogv player. They should just download VLC, but alas, some are a little hard to convince. So, I’ve been using ffmpeg to make some conversions of the files into an mp4 format as well:

ffmpeg -i B2_FastBoot.ogv -c:v libx264 -preset veryslow -crf 22 -c:a libmp3lame -qscale:a 2 -ac 2 -ar 44100 B2_FastBoot.mp4

So, if you had any doubts about video editing on Linux, I can assure you, there are dozens of really great tools out there just for that purpose!

Linux – keep it simple.