Difference between revisions of "PS3 Mediaserver"

From ArchWiki
Jump to: navigation, search
(Indexing)
(11 intermediate revisions by 6 users not shown)
Line 1: Line 1:
[[Category:Networking]]
+
[[Category:Web Server]]
 +
[[ja:PS3 Mediaserver]]
 
Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.
 
Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.
  
Install pms from AUR.
+
== Installation ==
 +
Install {{AUR|pms}} from [[AUR]].
  
The following is an example config file. Edit it to reflect the location of your folders.
+
== Configuration ==
 +
The default install location is /opt/pms and the config file is at /opt/pms/PMS.conf, there are comments describing what each option is for.
  
{{hc|/opt/pms/PMS.conf|2=
+
If running headless on a server
folders = <comma-separated list of folders that hold your media>
+
{{hc|Operating Mode|
hostname = <optional, preferably leave blank. If not, use IP-address or FQDN>
+
minimized &#61; true}}
port = <optional, default 5001>
+
 
network_interface = <optional, only use if pms chooses wrong interface>
+
If you don't want your entire filesystem to be shown
language =
+
{{hc|Media Locations|
thumbnails = true
+
folders &#61; /directory.you.want.shared/,/another.directory
thumbnail_seek_pos = 10
+
}}
nbcores = 2 # number of cores the cpu has
+
 
turbomode = true
+
If you run into issues with the wrong audio track playing (example: English desired)
minimized = false
+
{{hc|Audio language priority|
hidevideosettings = false
+
mencoder_audiolangs &#61; eng,und
charsetencoding = 850
 
engines = mencoder,avsmencoder,tsmuxer,mplayeraudio,ffmpegaudio,tsmuxeraudio,mencoderwebvideo,mplayervideodump,mplayerwebaudio,ffmpegdvrmsremux
 
autoloadsrt = true
 
avisynth_convertfps = true
 
avisynth_script = #AviSynth script is now fully customisable
 
transcode_block_multiple_connections = false
 
tsmuxer_forcefps = true
 
tsmuxer_preremux_pcm = false
 
tsmuxer_preremux_ac3 = false
 
audiochannels = 6
 
audiobitrate = 384
 
maximumbitrate = 0
 
skiploopfilter = false
 
enable_archive_browsing = false
 
mencoder_fontconfig = false
 
mencoder_font =
 
mencoder_forcefps = false
 
mencoder_usepcm = false
 
mencoder_intelligent_sync = true
 
mencoder_decode =
 
mencoder_encode = keyint=1:vqscale=1:vqmin=2
 
mencoder_nooutofsync = true
 
mencoder_audiolangs = dut,eng
 
mencoder_sublangs = dut,eng
 
mencoder_audiosublangs = dut,eng
 
mencoder_subfribidi = false
 
mencoder_ass_scale = 1.0
 
mencoder_ass_margin = 10
 
mencoder_ass_outline = 1
 
mencoder_ass_shadow = 1
 
mencoder_noass_scale = 3
 
mencoder_noass_subpos = 2
 
mencoder_noass_blur = 1
 
mencoder_noass_outline = 1
 
mencoder_subcp = cp1252
 
mencoder_ass = false
 
mencoder_disablesubs = false
 
mencoder_yadif = false
 
mencoder_scaler = false
 
mencoder_scalex = 0
 
mencoder_scaley = 0
 
ffmpeg = -g 1 -qscale 1 -qmin 2
 
# The next value has to be chosen very carefully: to low = possible stuttering if the network is congested, but
 
# to high causes the java heap to be to small. Check the -Xmx-setting in /opt/pms/PMS.sh and raise it to 1024M
 
# or higher if you see unexplainable Out Of Memory-errors in the debug.log
 
maxvideobuffer = 400
 
use_mplayer_for_video_thumbs = false
 
# The next value sorts your media files. 0 (default) = A-Z while 1 = Z-A
 
sort_method =
 
usecache = true
 
mencoder_encode = keyint=1:vqscale=1:vqmin=3
 
 
}}
 
}}
  
There are numerous other options, but they are completely undocumented. A list with all options can be found [http://ps3mediaserver.org/forum/viewtopic.php?f=3&t=254&hilit=pms.conf#p15283 here].
+
Example of english subtitles desired, no subtitles by default on English programs
* Do:
+
{{hc|Subtitle language priority|
{{bc|
+
mencoder_sublangs &#61; loc,eng,und
# mkdir /opt/pms/database
 
# chown <username> /opt/pms/database
 
# chown <username> /var/log/pms.log
 
# /etc/rc.d/pms start
 
 
}}
 
}}
* Use your web browser to go to: http://<ip-address-of-your-server>:5001/console/home and click on 'index files and folders'
 
* (optionally) watch the output with 'tail -f /var/log/pms.log' or 'tail -f /opt/pms/debug.log' for any problems.
 
* After the indexing has ended, you are done.
 
  
In order to run it as a daemon, use the following modified daemon script (originally from pms-svn).
+
A list with all options can be found [http://ps3mediaserver.org/forum/viewtopic.php?f=3&t=254&hilit=pms.conf#p15283 here].
 +
 
 +
== Run as a daemon ==
 +
=== SysVinit ===
 +
 
 +
Use the following modified daemon script (originally from pms-svn).
 
{{hc|/etc/rc.d/pms|
 
{{hc|/etc/rc.d/pms|
 
#!/bin/bash
 
#!/bin/bash
Line 137: Line 87:
 
}}
 
}}
  
{{hc|/etc/conf.d/pms|2=
+
# /etc/rc.d/pms start
PMS_USER='<user name to run it as>'
+
 
}}
+
* (optionally) watch the output with 'tail -f /var/log/pms.log' or 'tail -f /opt/pms/debug.log' for any problems.
 +
 
 +
=== systemd ===
 +
 
 +
The package ships a systemd unit file by default now (since 1.71.0-2). After installation just run:
 +
 
 +
# systemctl daemon-reload
 +
# systemctl start pms@<username> # to start once
 +
# systemctl enable pms@<username> # automatically start at boot
 +
# journalctl -u pms@<username> # to debug the logfiles
 +
 
 +
== Indexing ==
 +
This should be done automgically upon starting the service, but if it doesn't, this is how to do it manually:
 +
* Browse the logs to see at what ip-address and port pms has started the built-in webservice
 +
* Use your web browser to go to: <nowiki>http://<ip-address-of-your-server>:5001/console/home</nowiki> and click on 'index files and folders'
 +
* After the indexing has ended, you are done.

Revision as of 20:08, 2 December 2013

Server implemented in java. Has very good default transcoding profiles for several clients, but lacks good information for headless servers.

Installation

Install pmsAUR from AUR.

Configuration

The default install location is /opt/pms and the config file is at /opt/pms/PMS.conf, there are comments describing what each option is for.

If running headless on a server

Operating Mode
minimized = true

If you don't want your entire filesystem to be shown

Media Locations
folders = /directory.you.want.shared/,/another.directory

If you run into issues with the wrong audio track playing (example: English desired)

Audio language priority
mencoder_audiolangs = eng,und

Example of english subtitles desired, no subtitles by default on English programs

Subtitle language priority
mencoder_sublangs = loc,eng,und

A list with all options can be found here.

Run as a daemon

SysVinit

Use the following modified daemon script (originally from pms-svn).

/etc/rc.d/pms
#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions
. /etc/conf.d/pms

PID=`cat /var/run/pms.pid 2> /dev/null`
[ -z "$PID" ] && PID=`ps -Ao pid,command | grep java | grep pms.jar | awk '{print $1}'`

case "$1" in
	start)
		stat_busy "Starting PS3 Media Server"
		if [ -z "$PID" ]; then
			if [ -n "$PMS_USER" ]; then
				su -s '/bin/sh' $PMS_USER -c "/usr/bin/ps3mediaserver &>> /var/log/pms.log" &
			else
				/usr/bin/ps3mediaserver &>> /var/log/pms.log &
			fi
			PID=$!
			if [ $? -gt 0 ]; then
				stat_fail
			else
				echo $PID > /var/run/pms.pid
				add_daemon pms
				stat_done
			fi
		fi
		;;
	stop)
		stat_busy "Stopping PS3 Media Server"
		[ ! -z "$PID" ]  && kill $PID &> /dev/null
		while ps -p $PID &> /dev/null; do sleep 1; done
		if [ $? -gt 0 ]; then
			stat_fail
		else
			rm /var/run/pms.pid 2> /dev/null
			rm_daemon pms
			stat_done
		fi
		;;
	restart)
		$0 stop
		sleep 1
		$0 start
		;;
	*)
		echo "usage: $0 {start|stop|restart}"
		;;
esac
exit 0
# /etc/rc.d/pms start
  • (optionally) watch the output with 'tail -f /var/log/pms.log' or 'tail -f /opt/pms/debug.log' for any problems.

systemd

The package ships a systemd unit file by default now (since 1.71.0-2). After installation just run:

# systemctl daemon-reload
# systemctl start pms@<username> # to start once
# systemctl enable pms@<username> # automatically start at boot
# journalctl -u pms@<username> # to debug the logfiles

Indexing

This should be done automgically upon starting the service, but if it doesn't, this is how to do it manually:

  • Browse the logs to see at what ip-address and port pms has started the built-in webservice
  • Use your web browser to go to: http://<ip-address-of-your-server>:5001/console/home and click on 'index files and folders'
  • After the indexing has ended, you are done.