UShare:zh TW

From GeeXboX wiki

Jump to: navigation, search

GeeXboX uShare
A free UPnP A/V Media Server for Linux


Contents

Introduction

uShare 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.

GeeXboX uShare is able to provide access to both images, videos, music or playlists files (see below for a complete file format support list). It does not act as an UPnP Media Adaptor and thus, can't transcode streams to fit the client requirements.

uShare is written in C 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).

Latest News

Latest release of uShare is 0.9.7. See its ChangeLog :

  • Added new Microsoft Registrar service which fakes the authorization required to be able to stream to MS compliant Media Renderers.
  • Updated AVI file MIME type for better compliance with UPnP devices.
  • Better UPnP CDS compliance when request count and index are 0.
  • Removed the nasty characters from UDN naming for compatibility issues.
  • Force usage of libupnp >= 1.3.1 (previous versions of the library are buggy and should not be used).
  • Support for XboX 360, D-Link DSM-320 and Roku SoundBridge M2000 Network Music Player devices.

Copyright and License

uShare is copyright (C) 2005-2006 Benjamin Zores.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Note that uShare links with libupnp, which is licensed under the terms of a modified BSD license (i.e. the original BSD license without the advertising clause). This license is compatible with the GNU GPL.

Requirements

The following programs are required to build uShare:

  • GNU C Compiler (gcc), 2.95 or later.

The GNU C Compiler is part of the GNU Compiler Collection which can be downloaded from GNU gcc.

The following UPnP library is required to build and run uShare :

  • Linux SDK for UPnP Devices (libupnp), 1.3.1 or later

The libupnp library is used to communicate using the UPnP protocol. libupnp can be downloaded from uPnP.

Building and Installation

Compile uShare by running configure and then make. This should produce an executable ushare in the src subdirectory, which can be used right away. No extra files need to be installed. Example :

     CFLAGS="-Os" ./configure --prefix=/usr
     make

If you want to install uShare on your system, run :

     make install-strip

This will copy the executable and manual page into their appropriate directories (/usr/bin and /usr/man/man1 in this example). For more information regarding configure and make, see the INSTALL document.

Usage

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 239.0.0.0 netmask 255.0.0.0 eth0

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

     Options:
        -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

You can also perform remote control of uShare UPnP Media Server through its web interface. This let you define new content locations at runtime or update the currently shared one in case the filesystem has changed.

Just go to :

     http://ip_address:port/web/ushare.html

See the manual page for more details :

     man ushare

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
  • 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
  • Images files : bmp, ico, gif, jpeg, jpg, jpe, pcd, png, pnm, ppm, qti, qtf, qtif, tif, tiff
  • Playlist files : pls, m3u, asx
  • Subtitle files : dks, idx, mpl, pjs, psb, scr, srt, ssa, stl, sub, tts, vsf, zeg
  • Various text files : bup, 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.

Download

The currently available uShare release is 0.9.7. Sources can be downloaded here.

Debian Package

If you're using Debian or Ubuntu GNU/Linux distribution, you can also grab the binary for i386. uShare is also available through apt-get. Simply add the following line to your /etc/apt/sources.list file :

     deb http://www.geexbox.org/debian/ unstable main

Fedora Package

If you're using Fedora FC4 GNU/Linux distribution, you can also grab the binary for i386.

Development Tree

The latest uShare development tree can be grabbed using GNU Arch, a revision control system, similar in purpose to tools such as CVS, SCCS, and Subversion. It is used to keep track of the changes made to a source tree and to help programmers combine and otherwise manipulate changes made by multiple people or at different times.

There are currently 2 ways of accessing the Arch tree : via command-line or Web-Arch (to just have a look to some changes on a specific file, for example). You can directly access to the Web-Arch with your browser from :

uShare Web-Arch

In order to access to Arch via command line, create and enter a new directory and do the following (be sure that you have installed the TLA package) :

     * tla register-archive [email protected] http://www.geexbox.org/arch - To register with the GeeXboX's Arch repository.
     * tla get -A [email protected] ushare--main--0 - To fetch all the files from the directory geexbox.
     * tla update - To update your local copy of the Arch, synchronizing with our server.

Old Releases

Old releases of uShare can be found on our releases depository.

Feedback

The author of uShare and this document, Benjamin Zores, can be contacted by e-mail.

Please send bug reports, suggestions, ideas, comments or patches to :

[email protected]

Known bugs and limitations

If you need to listen on more than one interface, you will have to start multiple instances of the media server.

uShare keeps some information on files in memory. If your multimedia collection is huge, this might be a problem.

Links

Below is a short list of UPnP related software :

  • djmount : a software using FUSE to mount UPnP A/V Media Servers content as a Linux filesystem.
  • GMediaServer : the original Media Server on which uShare was based.
  • GeeXboX : the Linux multimedia distribution that uses djmount to provide access to UPnP contents.

Thanks

Many thanks to Oskar Liljeblad for its original work on GMediaServer (which is much more functionnal in terms of UPnP A/V features that uShare will ever be).

譯者: wade(dot)fs(at)gmail(dot)com

Personal tools