Jeremy Sands

Res publica non dominetur

How to convert video for playback on your Motorola Droid

Things you will need:
– Linux
– ffmpeg
– A Droid, dummy

Warning: I do have all the freedom hating codecs installed. You will have to output to H.264, and depending on your inputs, you may need to hate freedom even more than that. 😛

ffmpeg -i filein.mp4 -y -subq 6 -deinterlace -level 30 -f mp4 -acodec libfaac -ab 160k -ar 48000 -ac 2 -vcodec libx264 -b 2000k -maxrate 2000k -bufsize 2000kb -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -coder 0 -refs 2 -flags +loop -vol 256 -trellis 1 -me_method umh -async 1 -s wvga fileout.mp4

A few nifty Linux video tricks with cat

Have a webcam or a TV tuner? Need to test it to make sure it’s working? Have some video files you want to combine? You’d be surprised what the command line tool cat can do.

Test a webcam or TV Tuner:
# cat /dev/v4l/video0 > /tmp/vidtest.mpg
(Note, your device may be video1 or similar.) Wait a few seconds. Then hit Ctrl+C.

Now run:
# mplayer /tmp/vidtest.mpg

Need to merge pesky split wmv files? The ones ending in .wmv.001 and .wmv.002?
$ cat part1.wmv.001 part2.wmv.002 part3.wmv.003 > mergedfile.wmv

Need to merge AVI files? Even ones encoded in DivX or XviD?
$ cat file1.avi file2.avi file3.avi > mergedfile.avi
$ mencoder -forceidx -oac copy -ovc copy mergedfile.avi -o finalmergedfile.avi

/etc/bash/bashrc or ~/.bashrc

One of the things you’ll notice about Linux distros is that they often have different color schemes for the command line. I always found Gentoo’s default to be head and shoulders above all others. That’s great if you’re using Gentoo, but what if you don’t? Well this post includes the full Gentoo .bashrc file (as of the final 2008 release of Gentoo). And if you’re using ArchLinux, you can be lazy and simply use my pre-existing package in AUR.

Continue reading →