Device specific settings
From FUPPES
Contents |
device settings
fuppes has the ability to handle UPnP devices differently. This article describes how this is done and how to edit or add devices.
The basic fuppes configuration comes with a "default device" and some examples for specific devices. The "default device" is the base for our configuration. All other devices inherit the "default device's" settings and can override or extend them.
Open the fuppes.cfg in your favourite text or xml editor and look for the "<device_settings>" node. You will find a structure that looks like this (shortened):
<device_settings>
<device name="default">
...
<description_values>
...
</description_values>
<file_settings>
...
</file_settings>
</device>
<device name="PS3" enabled="false">
...
</device>
<device name="Xbox 360" virtual="Xbox 360" enabled="false">
...
</device>
</device_settings>
<device>
Let's have a look at the "<device>" node:
<device name="Xbox 360" virtual="Xbox 360" enabled="false">
- The "name" attribute sets the device's name. You can enter what ever you like.
- The "virtual" attribute specifies the virtual container structure that should be used for this device. This name must exactly match the names in vfolder.cfg. If this attribute is missing the "default" folder struture - if any - will be used.
- The "enabled" attribute enables or disables the device setting.
Let's have a closer look at the available device options.
The default device can have one or more of the following options:
<max_file_name_length>0</max_file_name_length> <playlist_style>file</playlist_style> <show_childcount_in_title>false</show_childcount_in_title> <enable_dlna>false</enable_dlna> <transcoding_release_delay>4</transcoding_release_delay> <xbox360>false</xbox360> <show_empty_resolution>false</show_empty_resolution>
- max_file_name_length
specifies the maximum length of filenames and titles in the UPnP descriptions. Some devices can't handle an unlimited length.
0 or empty = unlimited
default: 0 - playlist_style
send playlists as playlist files or as UPnP playlist containers.
file|container
default: file - show_childcount_in_title
show the childcount in container titles.
true | false
default: false - enable_dlna
enabled extended UPnP descriptions containing DLNA stuff.
true | false
default: false - transcoding_release_delay
set the delay between the last request and release of a transcoded file.
delay in seconds
default: 4 - xbox360
The Xbox 360 needs some special handling.
true | false
default: false - show_empty_resolution
Will show a resolution of "0x0" if set to true when image resolution cannot be obtained (if imagemagick is not enabled for example).
true | false
default: false
Specific devices should have some more nodes:
<user_agent>UPnP/1.0 DLNADOC/1.00</user_agent> <user_agent>PLAYSTATION3</user_agent> <ip>192.168.0.123</ip>
- user_agent
A device can have one or more "user_agent" nodes. These values are used for device detection. If you have more than one device it is wise to set the ip address to avoid collisions of the user agents. - ip
Set the device's ip address.
<description_values>
<description_values> <friendly_name>%s %v (%h)</friendly_name> <manufacturer>Ulrich Voelkel</manufacturer> <manufacturer_url>http://fuppes.ulrich-voelkel.de</manufacturer_url> <model_name>Free UPnP Entertainment Service</model_name> <model_number>%v</model_number> <model_url>http://fuppes.ulrich-voelkel.de</model_url> <model_description enabled="true">A free UPnP A/V MediaServer</model_description> <upc enabled="true"/> <serial_number enabled="true">1234567890</serial_number> </description_values>
%s = short name (FUPPES) %v = version %h = hostname
<file_settings>
The last important thing is understanding the "file settings". First let's have a look at the mp3 file setting:
<file ext="mp3"> <type>AUDIO_ITEM</type> <mime_type>audio/mpeg</mime_type> <dlna>MP3</dlna> </file>
- attribute ext
the file extension - type
set the UPnP object type of this file type
- AUDIO_ITEM
- AUDIO_ITEM_MUSIC_TRACK
- IMAGE_ITEM
- IMAGE_ITEM_PHOTO
- VIDEO_ITEM
- VIDEO_ITEM_MOVIE
- PLAYLIST
- mime_type
the file's mime/type - dlna
the file's DLNA-extension if any
audio transcoding
The ogg settings give a good example on how to enable audio transcoding
<file ext="ogg">
<type>AUDIO_ITEM</type>
<mime_type>application/octet-stream</mime_type>
<transcode enabled="true">
<ext>mp3</ext>
<mime_type>audio/mpeg</mime_type>
<dlna>MP3</dlna>
<http_encoding>stream</http_encoding>
<decoder>vorbis</decoder>
<encoder>lame</encoder>
<bitrate>256</bitrate>
<samplerate>44100</samplerate>
</transcode>
</file>
The "ext", "type" and "mime_type" settings are the same as described above for mp3. ogg has no DLNA extension so it is not set. The interesting part is the "<transcode>" node.
- attribute enabled
Dis-/enable transcoding for that file type. - ext
the target file extension - mime_type
the target mime/type - dlna
the target DLNA extension - http_encoding
the http encoding used to send transcoded files.
stream | chunk
default: stream - decoder
the decoder
vorbis | flac | mpc | faad - encoder
the encoder
lame | twolame | wav | pcm - bitrate
the encoder's bitrate
default depends on selected encoder - samplerate
the encoder's samplerate
default depends on selected encoder
Remark: Even if disabled fuppes will parse the "default device's" transcoding settings so that other devices simply can enable the transcoding and maybe change some values.
image conversion/rescaling
<file ext="jpg">
<ext>jpeg</ext>
<type>IMAGE_ITEM</type>
<mime_type>image/jpeg</mime_type>
<convert enabled="false">
<dcraw enabled="false">-q 0</dcraw>
<ext>png</ext>
<mime_type>image/png</mime_type>
<height>0</height>
<width>0</width>
<greater>false</greater>
<less>false</less>
</convert>
</file>
- attribute enabled
En-/disable image conversion for this file type - dcraw
- attribute enabled
Use dcraw if available - value
additional dcraw arguments ("-q 0" is the fastest)
- attribute enabled
- ext
the target extension. If not set the original type is retained. - mime_type
the target mime/type. If not set the original type is retained. - height and width
the resutlt's maximum height and width. aspect ratio gets preserved. - greater
resize only if greater
true | false - less
resize only if less
true | false
Note: If you set both greater and less to true the image is not resized.
video transcoding
Note: You have to compile fuppes with --enable-video-transcoding in order to use it.
The Windows release supports video transcoding out of the box.
The following example shows the settings to transcode Flash video (the format used by youtube) to mpeg.
<file ext="flv">
<type>VIDEO_ITEM</type>
<mime_type>application/x-flash-video</mime_type>
<transcode enabled="true">
<ext>mpg</ext>
<mime_type>video/mpeg</mime_type>
<transcoder>ffmpeg</transcoder>
<video_codec>mpeg1video</video_codec>
<audio_codec>mp2</audio_codec>
<audio_samplerate>44100</audio_samplerate>
<video_bitrate>1800000</video_bitrate>
</transcode>
</file>
- attribute enabled
Dis-/enable transcoding for that file type. - ext
the target file extension - mime_type
the target mime/type - transcoder
the transcoder to use
there is only ffmpeg available. - video_codec
the video encoder
run ffmpeg -formats to see available de-/encoders - audio_codec
the audio encoder
run ffmpeg -formats to see available de-/encoders - audio_samplerate
the audio encoder's samplerate in Hz - audio_bitrate
the audio encoder's bitrate in bits/s - video_bitrate
the video encoder's bitrate in bits/s
For renderer devices that don't support special video and/or audio formats you can set a filter. The following example shows some possible settings for the Telegent TG 100 which does not support divx3.
<file ext="avi">
<type>VIDEO_ITEM</type>
<mime_type>video/x-msvideo</mime_type>
<transcode enabled="true">
<transcoder>ffmpeg</transcoder>
<ext>mpg</ext>
<mime_type>video/mpeg</mime_type>
<video_codec vcodec="wmv2, msmpeg4">mpeg1video</video_codec>
<audio_codec acodec="wmav2">mp2</audio_codec>
<video_bitrate>1800000</video_bitrate>
<audio_samplerate>44100</audio_samplerate>
</transcode>
</file>
- video_codec
- attribute vcodec
transcode only if input file uses one of the given video codecs.
- attribute vcodec
- audio_codec
- attribute ccodec
transcode only if input file uses one of the given audio codecs.
- attribute ccodec
To check the audio and video codecs of your files open the fuppes.db with sqlite3 or sqlitebrowser and execute the following statement:
select
A_CODEC, V_CODEC
from
OBJECT_DETAILS where ID = (
select
DETAIL_ID
from
OBJECTS
where PATH="/absolute/path/to/your.file"
);
