For the reference, I found that mimeopen helps to set via command line.
To set the file type to open with particular program use mimeopen as follows.
Upon asking, choose the program if present in the menu. As mplayer was not available, I chose #2.
Please choose a default application for files of type video/x-matroska
1) Movie Player (totem)
use application #2
use command: mplayer
Opening ".avi" with mplayer (video/x-matroska)
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
File not found: '.avi'
Failed to open .avi.
Exiting... (End of file)
Now, If I open any .avi files via GUI, it opens, by default, with mplayer.