« Amusing LED HatGrandTec Grand IP Camera 3 firmware update »

HOWTO: Play video from SAMBA share without mounting

Technical, Linux/Unix, 440 words   Bookmark and Share

Some people like myself have had issues of wanting to play audio and videos files from a Windows SAMBA shared directory and have been told that you can only do so if you mount the smb shared directory first as access the files as local files. I have been using this setup since Ubuntu Dapper till Ubuntu Gutsy with no problems.

This HOWTO shows a method of playing videos using MPlayer directly from nautilus window without having to mount the shared directory.

Packages that you need from you favourite ubuntu mirror:

  • mplayer
  • nautilus-actions-config
  • necessary samba packages (not sure which is critical but I have installed samba-common, libsmbclient, smbfs and smbclient

The latest standard MPlayer package actually supports smb and you can check by running the following in terminal with a valid smb address:


mplayer smb://192.168.1.3/shared/example.avi

If this doesnt work, then you either need the latest mplayer or samba client package.

Once we know that mplayer supports smb, we need to next configure a handler for opening movie files with mplayer. I tried to simply use the “Open With” action in nautilus but it never seemed to fire up mplayer with the correct file details, hence I had to use nautilus-actions-config to configure individual action.

After installing nautilus-actions-config package, simply run nautilus-actions-config from terminal. This should bring up a new dialog box where you can create a new action.

For quick setup, enter the following;
Menu item and Action:
Label: Open with Mplayer
Path: /usr/bin/mplayer
Parameters: %u

Parameters Legend

  • %u: gnome-vfs URI
  • %h: hostname of the gnome-vfs URI
  • %d: base folder of the selected file(s)
  • %s: scheme of the gnome-vfs URI
  • %%: a percent sign
  • %U: username of the gnome-vfs URI
  • %f: the name of the selected file or the 1st one if many are selected
  • %M: space-separated list of the selected file(s)/folder(s) with their full paths
  • %m: space-separated list of the basenames of the selected
    file(s)/folder(s)

* For params you can further add mplayer parameters such as -cache 8192 for possibly smoother stream across network where 8192 is the size of the cache *

Under the Advanced Conditions tab:

You can check smb windows shares and you can uncheck the rest if you wish. This means that your custom action will only appear for smb windows shares.

Handling Authenticated Windows SMB shares

This approach can also allow the handling of secured Windows shares.

Under the Parameters field, simply enter something like the following,


-cache 8192 %s://SMBUSER:SMBPASSWORD@%h%M

Where SMBUSER and SMBPASSWORD are your secret username and passwords. As for the % parameters, please check the corresponding entry from the Parameters Legend above.

September 2024
Mon Tue Wed Thu Fri Sat Sun
            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
30            
 << <   > >>
Brinley Ang

Brinley Ang is a software engineer, sysadmin, coder, geek boy, jedi knight fragger, caffine addict, deaf meloncholic and rockstar wannabe. Listens to the sex pistols and a wide assortment of heavy metal.

Make payments with PayPal - it's fast, free and secure!
Search
home | portfolio | blog | links | contact
© 2024 - Brinley Ang
Valid xhtml