Jump to content

Media Server 2.x API Changes

Recommended Posts


Beginning with DVBViewer Media Server 2.0 (former Recording Service), the API changes are no more published in the News & Announcement forum, but here (English only) . Additionally they are contained in the file changelog_en_dms.html (see docs sub-directory of the Media Server installation directory).

Changes in DVBViewer Media Server 2.0:

  • Added: API: /api/epg.html now supports an additional parameter utc=1 that lets the Media Server output all EPG times as UTC instead of local time. Please note that the start=... and end=... parameters must also be specified as UTC in this case!

  • Added: API: scheme=xxx parameter for /api/timeradd.html and /api/timeredit.html. It sets the file naming scheme for the recording. The character coding is specified by the encoding parameter (as for title, folder and series).

  • Added: API: Possibility to retrieve the EPG Event ID of a recorded program with /api/recodings.html&eventid=1. The value 0xFFFFFFFF = 4294967295 indicates that no Event ID is available.

  • Fix: API: If a single channel was requested with /api/getchannelsxml.html (followed by number=..., id=... or epgid=...) that didn't exist the Recording Service delivered the whole channel list. Now the output is an empty <channels> tag.

  • Added: API: /api/getchannelsxml.html now allows to limit the output to TV channels (tvonly=1), to radio channels (radioonly=1) or to channels for which EPG data is currently available (epgonly=1).

  • Added: API: Search for an EPG item with a certain Event ID or PDC by using /api/epg.html?channel=[EPGChannelID]&eventid=... or &pdc=. Both require specifying a channel. If an Event ID or PDC is specified other search criteria like time or search items are ignored. Please note that searching for an Event ID will only yield one result (if at all). A PDC search may deliver more than one result in case of split programs, e.g. sport events interrupted by news (see here).

  • Added: API: Possibility to selectively delete EPG data originating from a certain source with the epgclear API:


The numeric value [Sources] specifies the to be deleted EPG types as flags that can be or'ed  (1 = DVB EPG 2 = MHW EPG, 4 = External EPG). If [Sources] is not specified the default is all EPG data (currently 7).

  • Added: API: Possibility to directly download any file from the media file directories with


where video=1 (default), audio=1 or photo=1 specify the media type, dirid=[ID] a directory ID retrieved with /api/mediafiles.html and file=[filename] the UTF-8 name of the file that shall be delivered. If [filename] is a mask containing a “*” character the API enumerates all matching files separated by CR/LF as plain UTF-8 text. Thus *.* enumerates all files in the directory. Using a slash or backslash as part of the filename for accessing parent- or sub-directories is not allowed.

  • Added: API: Possibility to get tables from the Media Server databases as XML output by using SQLite queries:

/api/sql.html?[video/audio/photo/rec]=1&query=[SQLite query]

where video=1 (default), audio=1, photo=1 or rec=1 specify the database. The access is restricted to “read only”. You may use the attached database diagrams (see below)  or the SQLiteBrowser to get insight into the database structures.

  • Added: API/Trancoded Streaming (HLS): Two new parameters adjustpts and recfile can be used to control how jumping to a different position on HLS file playback is handled. Details are described in the file transcoding_params_en.txt (see Docs sub-directory of the Media Server installation directory).

  • Added: API/Transcoded Streaming (TS): Possibility to set up permanent transcoded TS streams that are running independently from client connections and can be accessed by a (theoretically) unlimited number of clients at the same time, but only require a single FFmpeg instance.

The stream is started with 


[unique_name] is a user defined identifier (e.g. the channel name). Additionally an ID specifying the media object (channel, file etc) that shall be transcoded is required. Other parameters are optional. The media server uses defaults if they are missing. The stream is stopped by


or by stopping the Recording Service. Clients can access the stream by using the following type of URL


No further parameters are required. Please note that transcoded TS streams set up by a client connection can also be accessed by other clients if the URL contains the same stream ID or if the query string (beginning with a question mark) is identical. Please also note that this does not work with WebM and Flash.

  • Added/Change: API/Channel List Download: As before downloading the file transcodedchannels.m3u requires specifying a TV preset and/or radio preset by using tvpreset=... and rpreset=... parameters, controlling whether TV and/or radio channels are contained in the list and which format is used. Additional parameters can be used to override the “Show Favorites Additionally / Show Favorites Only” user settings on the Web Interface configuration page that are applied by default. Each switch can be 0 (off) or 1 (on):

fav=0/1: Specifies if the favorites are added at the top of the channel list (if there are any).

favonly=0/1: Specifies if the channel list only contains favorites (if there are any).

Additionally, if the TV and Radio presets are specified by name, the Media Server now uses the iphoneprefs.ini if the name begins with “HLS”, otherwise the ffmpegprefs.ini (containing WebM/Flash/TS presets). If the presets are specified by zero based index, it depends on the user agent. If the Media Server detects Safari or Edge, it assumes that the index refers to HLS presets, otherwise to WebM/Flash/TS presets. However, this can also be controlled by parameter:

hls=0: The index refers to WebM/Flash/TS presets (ffmpegprefs.ini)

hls=1: The index refers to HLS presets (iphoneprefs.ini).

The following example downloads a channel list that only contains TV favorites. The format is HLS, using the second preset in the file iphoneprefs.ini:

  • Change/Added: API/Channel List Download: By default the Media Server filters the channels.m3u and rtspchannels.m3u download according to the “Show TV/Radio” and “Show Favorites Additionally / Show Favorites Only” user settings on the Web Interface configuration page. The following parameters can be used to override the settings and specify the content. Each switch can be 0 (off) or 1 (on):

fav=0/1: Specifies if the favorites are added at the top of the channel list .

favonly=0/1: Specifies if the channel list only contains favorites.

tv=0/1: Specifies if list contains TV channels.

radio=0/1: Specifies if list contains radio channels.

Everything not specified by parameters is up to the user settings. Please note that the favorite switches are ignored if there are no favorites. fav and favonly cannot both be 1 (setting one of them to 1 switches the other one off) and tv and radio cannot both be 0 (setting one of them to 0 switches the other one on) The following example downloads a channel list that only contains TV favorites:

  • Added: API/RTSP Server: Possibility to configure permanent UDP/RTP unicast and multicast streams (running independently from client access). Please note that this feature requires an extended license that allows for at least 50 Media Server clients at the same time. The streaming is performed by the RTSP server, but the configuration is done by using Web Server URLs that require full (user) access rights so it can be password protected. The URLs may use a channel ID or Sat>IP syntax to specify the data that shall be sent. The following parameters in the URL query part are supported:

    • ip=... (required) specifies the IPv4 destination address. It may be a multicast IP like or a local network address like for unicast.

    • port=... (required) specifies the destination port.

    • nic=... (optional) specifies the IP of the network adapter through which the data shall be sent. By default it is selected by Windows.

    • ttl=... (optional) specifies the “time to live” as integer number. The default is defined by the “Sat>IP/UPnP Multicast TTL” tweak (usually = 1, see DMSTweaker.bat, which means, the RTP multicast output is only accessible in the same subnet).

    • rtcp=1 (optional) lets the Media Server set up a Sat>IP multicast session. An additional RTCP announcement stream carrying Sat>IP information like signal quality is sent to the subsequent destination port.

Here are two configuration examples, the first one using a channel id for starting multicast, the second one using Sat>IP syntax (incomplete) for unicast:

http ;//|ZDF

http ;//

PAT and PMT are adjusted to the actual output. The stream is stopped by an URL that specifies the same IP and port. Additional parameters are ignored in this case. So the same URL can be used for switching the stream on/off.


Share this post

Link to post

Changes in DVBViewer Media Server 2.0.3:

  • Fix: API/EPG: /api/epg.html delivered no results in case of TS Stream channels with a native DVB EPG.
  • Added: API/Tasks: If /api/tasks.html is requested without parameter the Media Server delivers the whole task list as XML, reflecting how it is displayed on the Task Page of the web interface, but with After Recording Tasks included:
 <group name="EPG">
  <task type="0">
   <name>Start EPG Update</name>

The task type has the following meaning: 0 = predefined internal task, 1 = user defined process task, 2 = after recording task (user defined, should only be displayed in UIs allowing to create or edit recording timers).

Action is the command that must be sent to the Media Server for executing the task, e.g. /api/task.html?task=EPGStart. For consistency the API also allows to use /api/task.html?action=....

Share this post

Link to post

Changes in DVBViewer Media Server 2.0.4:

  • Added: API that allows DVBViewer and other clients to get channel → logo assignments from the server:


If the name and id parameters are both missing or empty the server delivers the current assignment table as plain UTF-8 text. The lines are id=logo filename pairs separated by CR and LF, in the same way as in the file ChannelLogos2.ini. If the channel name is specified the server searches the corresponding channel logo file algorithmically and returns the UTF-8 name. If the EPG Channel ID is specified the server picks the result from its assignment table (faster). If name and ID are specified the server first tries to get the channel logo filename from the assignment table, then in case of failure by algorithmic search and adds the result as new assignment to the table in order to speed up future access. If no logo can be assigned the server returns a hyphen (-). If no logos are available at all the server responds with 404 not found. The logo filename can be used to download the logo with the /logos/[filename] API from the web server. Please note that the logo filename may contain a relative path including backslashes (!) if the file is located in a sub-directory of \Images\Logos\.

  • Added: API: Extensions for /api/mediafiles.html (see here, API section). The new m3u parameter lets the Media Server deliver the list of media files contained in the specified directory as M3U file. Example:


The new recursive parameter lets the Media Server enumerate all files contained in the specified directory and its sub-directories. Additionally directories are listed if they do not contain media files, but only their sub-directories. Examples:



  • Added: API: New API for listing/adding/editing/deleting EPG search presets that are shown on the EPG search page of the web interface. Please note that this API requires user rights. With guest rights only listing the presets is allowed.

    • /api/searchlist.html. Lists the available presets as XML in the same ways as in the file \config\searches.xml. No parameters are required.

    • /api/searchdelete.html. Deletes a preset referenced by zero based index (id=...) or by name (name=...., case sensitive, UTF-8 coded). Example: searchdelete.html&name=Daily%20News. The Media Server responds with “404 not found” if the index is out of range or a preset with the given name does not exist.

    • /api/searchedit.html. Changes an already existing preset referenced by zero based index (id=...) or by name (name=....). See above.

    • /api/searchadd.html. Appends a new search preset to the end of the list.

The following search preset properties are output by the searchlist API and received as URL query parameters from the searchedit and searchadd APIs. Please note that Boolean values are indicated as integers (0 = false, values <> 0 = true). If parameters are missing the previous value or default remains untouched.

    • SearchPhrase (string): The word or phrase that shall be searched in the EPG data. This parameter is mandatory for the searchadd API and must not be empty.

    • Name (string): The name of the search preset. If no name is specified on searchadd the search phrase is used as name.

    • SearchFields (bit field as integer 1..7): Specifies in which parts of the EPG data the search phrase shall be searched. Bit 0 set: Title, Bit 1 set: Short description (subheading), Bit 2 set: Long description. The default is 3 (Bit 0 and 1 set, title and short description).

    • IgnoreCase (boolean): Specifies whether upper/lowercase are ignored. The default value is -1 (true).

    • UseRegEx (boolean): Specifies whether the search item shall be regarded as regular expression. The default value is 0 (false).

    • Days (bit field as integer 1..127): Weekday filter. EPG items starting on excluded days (corresponding bit not set) are ignored. Bit 0: Monday, Bit 1: Tuesday... etc. Bit 6: Sunday. The default is 127 (all days included).

    • StartDate, EndDate (dd.mm.yyyy or the word today/tomorrow as string): Date filter. EPG items with a start date before the specified start date or after the specified end data are ignored. By default the values are not set (unlimited). “today” or “tomorrow” as date are replaced by today's or tomorrow's date when the preset is used for a search (!) so it always remains “up-to-date”.

    • StartTime, EndTime (hh:mm as string): Time filter. EPG items with a start time before the specified start time or after the specified end time are ignored. The default values are 00:00 and 23: 59 (unlimited).

    • DurationMin, DurationMax (minutes as integer): Duration filter. EPG items with a duration less than the minimum duration or more than the maximum duration are ignored. The default values are 0 (unlimited).

    • Genre (integer): Genre filter. The genre values and their meaning are enumerated in the [content] section of the Media Server language files (e.g. rc_english.lng). Only EPG items with the given Genre are included. The default value is -1 (not specified, all genres accepted).

    • Channels (comma separated list of 64 bit integers): Channel filter. Specifies the EPG Channel IDs of the channels from which search results are collected. The default is an empty list (all channels).

    • AutoRecording (boolean): Specifies whether timer recordings are automatically created for the search results. The default is 0 (false).

The following properties only apply if AutoRecording is true:

    • CheckRecTitle, CheckRecSubtitle (boolean): If true timers are created in disabled state if the title or the short description (the subheading) of an EPG search result equals the corresponding strings of a program that has already been recorded (but is not necessarily present on disk because the comparison refers to the recording history database). The default for both is 0 (false).

    • CheckTimers (boolean): If true timers are created in disabled state if a timer with the same name (description) already exists. The description of timers created from EPG items is composed of the title and (if present) of the subheading separated by a blank, a hyphen and another blank. The default is 0 (false).

    • RecordingFolder (string): The complete path of the directory where recordings resulting from auto-timers shall be stored. The default is Auto, letting the Media Server auto-select the folder.

    • RecNameScheme (string): The file naming scheme for recordings. The default is the naming scheme configured by the user (see Media Server Options → Recordings).

    • RecFormat (integer): The recording format. Possible values are 0 = audio only elementary stream, 1 = transport stream with the exception of program stream (*.mpg) for MPEG2 video, 2 = always transport stream.

    • Series (string): This property has no special meaning in the Media Server. It can be used for user-defined UPnP grouping of recordings (see Web Interface → Media Page → Recordings → By Series). All recordings with the same Series string fall in the correspondent category. The default is an empty string (unspecified).

    • Shutdown (integer): Specifies whether and how the PC shall be shutdown when the recording is finished: 0 = no action, 1 = power off, 2 = sleep mode, 3 = hibernate. The default is 0 (no action).

    • AfterProcessAction (string): Specifies which After Recording Task shall be performed when the recording is done. It can be one of the actions enumerated by /api/tasks.html with task type = 2. The default is an empty string (no task).

    • EPGBefore, EPGAfter (minutes as integer): Specify the lead and follow-up time that is automatically added to the start end end time of timers. The default are the values specified by the user on Media Server Options → Recordings.

    • MonitorPDC (boolean): Specifies whether the start time of a timer shall be adjusted if the start time of the corresponding EPG item changes. Only takes effect if the broadcaster provides PDC (Program Delivery Control) The default is 0 (false).

    • MonitorForStart (boolean): Specifies whether the EPG running status shall be monitored for accurate recording. Only takes effect if the broadcaster provides PDC and MonitorPDC is also set to true. The default is 0 (false).

    • Priority (integer 0..100). Specifies the priority of auto-timers. 0 means low and 100 high priority. The default is 50 (medium priority). Recordings with higher priority may stop recordings with lower priority in case of competing DVB device access.

Share this post

Link to post
This topic is now closed to further replies.