Difference between revisions of "Ushare - UPnP Media Server for Linux"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (Configuration)
m (Supported File Formats List)
Line 6: Line 6:
uShare is free software - it is licensed under the terms of the [[w:GNU General Public License|GNU General Public License]] (GPL).
uShare is free software - it is licensed under the terms of the [[w:GNU General Public License|GNU General Public License]] (GPL).
===Supported File Formats List===
===Supported File Formats List===
* '''Video files''' : asf, avi, dv, divx, wmv, mjpg, mjpeg, mpeg, mpg, mpe, mp2p, vob, mp2t, m1v, m2v, m4v, m4p, mp4ps, ts, ogm, mkv, rmvb, mov, qt
* '''Video files''' : [[w:asf|asf]], [[w:avi|avi]], [[w:dv|dv]], [[w:divx|divx]], [[w:wmv|wmv]], [[w:mjpg|mjpg]], [[w:mjpeg|mjpeg]], [[w:mpeg|mpeg]], [[w:mpg|mpg]], [[w:mpe|mpe]], [[w:mp2p|mp2p]], [[w:vob|vob]], [[w:mp2t|mp2t]], [[w:m1v|m1v]], [[w:m2v|m2v]], [[w:m4v|m4v]], [[w:m4p|m4p]], [[w:mp4ps|mp4ps]], [[w:ts|ts]], [[w:ogm|ogm]], [[w:mkv|mkv]], [[w:rmvb|rmvb]], [[w:mov|mov]], [[w:qt|qt]]
* '''Audio files''' : aac, ac3, aif, aiff, at3p, au, snd, dts, rmi, mp1, mp2, mp3, mp4, mpa, ogg, wav, pcm, lpcm, l16, wma, mka, ra, rm, ram
* '''Audio files''' : [[w:ac|ac]], [[w:ac3|ac3]], [[w:aif|aif]], [[w:aiff|aiff]], [[w:at3p|at3p]], [[w:au|au]], [[w:snd|snd]], [[w:dts|dts]], [[w:rmi|rmi]], [[w:mp1|mp1]], [[w:mp2|mp2]], [[w:mp3|mp3]], [[w:mp4|mp4]], [[w:mpa|mpa]], [[w:ogg|ogg]], [[w:wav|wav]], [[w:pcm|pcm]], [[w:lpcm|lpcm]], [[w:l16|l16]], [[w:wma|wma]], [[w:mka|mka]], [[w:ra|ra]], [[w:rm|rm]], [[w:ram|ram]]
* '''Image files''' : bmp, ico, gif, jpeg, jpg, jpe, pcd, png, pnm, ppm, qti, qtf, qtif, tif, tiff
* '''Image files''' : [[w:bmp|bmp]], [[w:ico|ico]], [[w:gif|gif]], [[w:jpeg|jpeg]], [[w:jpg|jpg]], [[w:jpe|jpe]], [[w:pcd|pcd]], [[w:png|png]], [[w:pnm|pnm]], [[w:ppm|ppm]], [[w:qti|qti]], [[w:qtf|qtf]], [[w:qtif|qtif]], [[w:tif|tif]], [[w:tiff|tiff]]
* '''Playlist files''' : pls, m3u, asx
* '''Playlist files''' : [[w:pls|pls]], [[w:m3u|m3u]], [[w:asx|asx]]
* '''Subtitle files''' : dks, idx, mpl, pjs, psb, scr, srt, ssa, stl, sub, tts, vsf, zeg
* '''Subtitle files''' : [[w:dks|dks]], [[w:idx|idx]], [[w:mpl|mpl]], [[w:pjs|pjs]], [[w:psb|psb]], [[w:scr|scr]], [[w:srt|srt]], [[w:ssa|ssa]], [[w:stl|stl]], [[w:sub|sub]], [[w:tts|tts]], [[w:vsf|vsf]], [[w:zeg|zeg]]
* '''Various text files''' : bup, ifo
* '''Various text files''' : [[w:bup|bup]], [[w:ifo|ifo]]
If you want uShare to support more file formats, simply add its properties in the src/mime.c table. Do not forget to send a patch to update uShare.

Revision as of 16:09, 30 October 2006



uShare (http://ushare.geexbox.org/) is a Upnp (TM) A/V Media Server. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients. uShare is written for the GeeXboX project. It is designed to provide access to multimedia contents to GeeXboX but can of course be used by any other UPnP client device. It should compile and run on any modern POSIX compatible system such as Linux uShare is free software - it is licensed under the terms of the GNU General Public License (GPL).

Supported File Formats List


Ipkg (PowerPC)

OpenLink PowerPC only

ipkg install ushare

Compile from Source

  1. Install the Precompiled C development environment, running on the LS
  2. Then get the source files install them
wget http://ushare.geexbox.org/releases/ushare-0.9.7.tar.bz2
wget http://ovh.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz

Configure, make and install libupnp1.3.1

tar -xvzf libupnp-1.3.1.tar.gz 
cd libupnp-1.3.1
make install

Then configure, make and install ushare

tar -xvjf ushare-0.9.7.tar.bz2
cd ushare-0.9.7
make install


At first you need to be sure that you have setup a multicast route for UPnP messages. If you don't but have a default route attributed, then this later will be used. Otherwise, simply declare a new route for UPnP multicasts (for example using eth0 interface) :

route add -net netmask eth0

uShare runs from the console only. It supports the usual --help option which displays usage and option information.

 -n, --name=NAME              Set UPnP Friendly Name (default is 'uShare')
 -i, --interface=IFACE        Use IFACE Network Interface (default is 'eth0')
 -p, --port=PORT              Forces the HTTP server to run on PORT
 -c, --content=DIR            Share the content of DIR directory (default is './')
 -w, --no-web                 Disable the control web page (enabled by default)
 -v, --verbose                Set verbose display.
 -D, --daemon                 Run as a daemon.
 -V, --version                Display the version of uShare and exit
 -h, --help                   Display this help

uShare expects at least one directory argument (-c argument), specifying where multimedia files are stored. You should probably also use the -i option to specify which interface uShare should listen on.

 ushare -c /shares
 ushare -c /shares1 --content=/shares2


To complete the installation, you must edit /opt/etc/ushare.conf to add the location(s) of your media files. After starting ushare you can go to the web interface to manage it's shares:



# /etc/ushare.conf
# Configuration file for uShare

# uShare UPnP Friendly Name (default is 'uShare').

# Interface to listen to (default is eth0).
# Ex : USHARE_IFACE=eth1

# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2

Then you can create a start/stop script


# Required-Start: $local_fs $syslog
# Required-Stop:
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop ushare
# Description:

DESC="uShare UPnP A/V Media Server"

[ -r "/etc/ushare.conf" ] && . /etc/ushare.conf

# abort if no executable exists
[ -x $DAEMON ] || exit 0

# abort if no shared directory is defined
[ -z "$USHARE_DIR" ] && exit 0

set -e

checkpid() {
  [ -e $PIDFILE ] || touch $PIDFILE
case "$1" in
    echo -n "Starting $DESC: $NAME"
    start-stop-daemon --start --quiet --background --oknodo \
      --make-pidfile --pidfile $PIDFILE \
      --exec $DAEMON -- $USHARE_OPTIONS
    echo "."
    echo -n "Stopping $DESC: $NAME"
    start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE
    echo "."
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
    $0 stop
    $1 start
    echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
    exit 2

exit 0

And run the following to have it startup and stop on system start/shutdown

cd /etc/rc.d/rc2.d
ln -s ../init.d/gmserver S99ushare
cd ../rc0.d
ln -s ../init.d/gmserver K02ushare
cd ../rc6.d
ln -s ../init.d/gmserver K02ushare


  • GMediaServer : the original Media Server on which uShare was based.
  • GeeXboX : the Linux multimedia distribution that uses djmount to provide access to UPnP contents.

Link.png This article is currently a stub. You can help this Wiki by expanding it

. This template will categorize articles that include it into Category:Stubs.