Adding 'Play Folder Content As DVD Video In SMPlayer' Entry To KDE Actions Service Menu


by AndrzejL

I have a bunch of folders on my hard drive containing DVD videos. These are family videos from Christmas, weddings, baptisms and other occasions recorded with my camcorder in DVD format, and then backed up to my HDD. I could rip them into .avi files just to make it easier to play them, but then I am risking losing the quality of the originals. It would be pointless, really – recording in DVD quality just to encode it to avi. If not the waste of quality, then definitely a waste of time and cpu power/electric energy.

Anyway, as you probably know, DVD video content is a whole structure. It’s not just one file, so it’s not as easy as going into the file’s folder and clicking on it to make it playable. There are .vob files inside that could be played one after another. Sure, but it’s a waste of time. Plus, each DVD has at least two to four of those .vob files. You would have to click on each of them to watch the entire video, and sometimes the rewinding or fast forwarding won’t work when you do that. Nah. That won’t work for me.

When you right click on something in KDE4, you get a context menu and one of the items in this menu is ‘Actions’. I have decided to add ‘Play content of this folder as DVD video in SMPlayer’ entry to this menu in PCLinuxOS KDE4.9.2. It took me a while, but I have succeeded. Here is how you do it.

First, make sure you have SMPlayer installed. Under PCLinuxOS 2012.08, VLC was set up as the default media player, so you will probably have to install it from Synaptic. After you install SMPlayer, open a terminal session and run these commands:

mkdir -p ~/.kde4/share/kde4/services/ServiceMenus/

kwrite ~/.kde4/share/kde4/services/ServiceMenus/playwithsmplayer.desktop

Then, paste this into Kwrite:

[Desktop Entry]

Type=Service

Version=1.0

Actions=PlayWithSmplayer;

Name=Play content of this folder as DVD video in SMPlayer.

GenericName=Play content of this folder as DVD video in SMPlayer.

Icon=/usr/share/icons/hicolor/64x64/apps/smplayer.png

ServiceTypes=ServiceTypes=KonqPopupMenu/Plugin

X-KDE-ServiceTypes=KonqPopupMenu/Plugin,inode/directory

[Desktop Action PlayWithSmplayer]

Name=Play folder content as DVD video in SMPlayer.

Exec=smplayer 'dvd://1//%U'

Icon=/usr/share/icons/hicolor/16x16/apps/smplayer.png

Now save the file. There. You’re all done.

Right click on any folder containing a DVD structure and choose Actions > Play folder content as DVD video in SMPlayer from the menu. SMplayer will start and will start playing DVD from the folder that you have chosen.