/dev/random

Random stuff to remember

Subscribe to RSS feed

Encode video for nokia (using mencoder)

, , , ...

Mencoder (a tool comes with mplayer) is a great encoding tool for linux. I've used this to encode raw videos, video cut/paste, extracting audio/video, encode for dvds, encode for many other players. The thing i like most about it is the fine control it gives to user.

So today i encoded a video for my mobile device (Nokia E66). Now i can watch those while traveling smile. E66 supports mp4 videos and has a resolution of 320x240. Here is the one liner for this:

$ mencoder -oac lavc -ovc lavc -lavcopts vglobal=1:aglobal=1:acodec=libfaac:vcodec=mpeg4:level=31 -of lavf -lavfopts format=mp4 -vf scale=320:-2 <in_video> -o <out.mp4>


man mplayer explains all the options in detail. The important thing here is scale=320:-2. 320 is the width my phone supports. -2 tells mencoder to adjust height according to prescaled aspect ratio.

Happy encoding smile.

Git - edit last commit

, ,

Git is a wonderful SCM. We use svn centrally as our source code repository. I use git-svn to create my local copy. My typical workflow is:
  1. Get updates from svn
    $ git svn rebase
  2. Make changes.
  3. Commit changes locally
    $ git commit -a
  4. Commit changes to svn
    $ git svn dcommit


There are times between step 3, and 4 when i want to edit my commit log message. Here are the steps i follow (shamelessly copied from here):
  1. Soft reset the current HEAD to HEAD^
    $ git reset --soft HEAD^
  2. Make changes to tree.
  3. Commit changes with editing last log message
    $ git commit -c ORIG_HEAD
  4. Commit changes to svn
    $ git svn dcommit
February 2012
M T W T F S S
January 2012March 2012
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29