Go to System Settings → System info → Default Applications, and set it there. It works in Ubuntu 11.10 (Oneiric Ocelot).
In Ubuntu 13.04 (Raring Ringtail) and later, it's found in System Settings → Details → Default Applications.
To do it command line like:
Check if totem is the default for your video:
cat /usr/share/applications/defaults.list | grep video
The output would be like(many other lines):
video/x-avi=totem.desktop
Append those lines to the file ~/.local/share/applications/mimeapps.list
This contain the mimeapps with theri association
cat /usr/share/applications/defaults.list | grep video >> ~/.local/share/applications/mimeapps.list
Now open the file
gedit ~/.local/share/applications/mimeapps.list
and replace all occurence of totem with vlc (you can use the shortcut Ctrl+H)
save and exit. enjoy
source and more info
Note: If you want to make it available for all users in your system you should replace all occurrence of totem with vlc in the /usr/share/applications/defaults.list
instead of ~/.local/share/applications/mimeapps.list
.
To do it GUI like:
Rightclick any video file, choose properties. Choose Open With
and there you can select VLC and the option set as default
(bottom right).
This requires you to do that for every video type (mp4, mpg , mpeg, mov ....)...
Another perfect method is to use the option in Default applications
.
go to "System Settings" "Details" "Default Applications"
CLick on the "down arrow" for "Video"
Select "VLC Media Player"
Then close window.
Best Answer
There's yet another GUI solution, which might come handy for you ;)
Try opening the properties (right click -> Properties) of the file type you want to be always played by VLC.
Choose the Open with tab and either choose from a list or add one (by choosing from an extended program list or simply typing vlc as the command)
EDIT:
... and click on Set as default