Table of Contents

Storage (REST API)

Retrieving Media Asset List

A query to the media database for a list of media assets. The query returns an XML-document with short descriptions of media assets in the whole database or a certain folder. Graphic templates have the mime_type field with the value 10.

GET http://<IP_ADDR>:7901/storage/<NAME>[/<FOLDER>[/<FOLDER>...]][?format=val[&datetime=val...][&mimetype=val...]]

An example of a server response to a media database query in StoredTree mode:

| response_storedtree_mediadb.xml
<StoredTree query_root="">
	<Folder name="">
		<Clip link_id="0" finalized="true">
			<Attr name="bps">16</Attr>
			<Attr name="channels">2</Attr>
			<Attr name="derived_from">CityViews2 HD</Attr>
			<Attr name="frame_time">0.0400000000</Attr>
			<Attr name="frames">3425</Attr>
			<Attr name="height">1080</Attr>
			<Attr name="orig_name">CityViews2 HD</Attr>
			<Attr name="orig_type">3</Attr>
			<Attr name="sample_rate">48000</Attr>
			<Attr name="width">1920</Attr>
			<Attr name="first_frame">0</Attr>
			<Attr name="last_frame">3425</Attr>
			<Attr name="title">CityViews3</Attr>
			<Attr name="create_time">2018-03-27T10:26:30</Attr>
			<Attr name="rec_time">2016-12-17T16:15:14</Attr>
		</Clip>
		<Clip link_id="3" finalized="true">
			<Attr name="bps">16</Attr>
			<Attr name="channels">2</Attr>
			<Attr name="derived_from">Hockey</Attr>
			<Attr name="frame_time">0.0400000000</Attr>
			<Attr name="frames">1501</Attr>
			<Attr name="height">1080</Attr>
			<Attr name="orig_name">Hockey</Attr>
			<Attr name="orig_type">3</Attr>
			<Attr name="sample_rate">48000</Attr>
			<Attr name="width">1920</Attr>
			<Attr name="first_frame">0</Attr>
			<Attr name="last_frame">1501</Attr>
			<Attr name="title">Hockey</Attr>
			<Attr name="create_time">2018-03-27T14:13:15</Attr>
			<Attr name="rec_time">2016-12-18T01:14:24</Attr>
		</Clip>
		<Folder name="New Folder"/>
		<Folder name="New Folder 1"/>
	</Folder>
</StoredTree>
</xml>

An example of a server response to a media database query in the MAM mode:

| response_mam_mediadb.xml
<mam>
	<asset>
		<id>CityViews3</id>
		<dir/>
		<length>00:02:17</length>
		<hires>
		$(video_path)/media/CityViews2_HD-NID0-3/CityViews2_HD.avi
		</hires>
		<proxy>
		$(video_path)/proxy/CityViews2_HD-NID0-19/CityViews2_HD_lrv.avi
		</proxy>
	</asset>
	<asset>
		<id>Hockey</id>
		<dir/>
		<length>00:01:00.04</length>
		<hires>$(video_path)/media/Hockey-NID3-51/Hockey.avi</hires>
	</asset>
</mam>

An example of a server response to a media database query in the Folderlist mode:

| response_folderlist_mediadb.xml
<StoredTree query_root="">
	<Folder name="">
		<Folder name="New Folder"/>
		<Folder name="New Folder 1"/>
	</Folder>
</StoredTree>

Query examples:

Retrieving Asset Information

A query to retrieve detailed information on the object (including names of parameters for graphic templates). The query returns an XML-document.

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>

Since version 2.9.69, TITLE for all quieries can be replaced by a namespace:id pair, where namespace is the key field name, and id is a unique value. For example:

GET http://<IP_ADDR>:7901/storage/<NAME>@house_number:H12345

Retrieving Asset Data

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>

An example of server response to a request to the media database for detailed information on an object:

| response_asset_mediadb.xml
<Clip folder="clips" hires="$(video_path)/media/CityViews2_HD-NID0-3/CityViews2_HD.avi" proxy="$(video_path)/proxy/CityViews2_HD-NID0-19/CityViews2_HD_lrv.avi" archive="" link_id="0" finalized="true">
	<Marker uid="1" pos="1929">
		<Attr name="user"/>
		<Attr name="title"/>
		<Attr name="comment">111222333</Attr>
		<Attr name="track">General</Attr>
		<Attr name="keywords"/>
		<Attr name="rating">0</Attr>
	</Marker>
	<Segment seg_num="1" seg_name="Seg1" start_frame="0" duration="150">
		<title>Seg1</title>
		<title>333222111</title>
		<track>Segments</track>
		<rating>0</rating>
	</Segment>
	<Attr name="bps">16</Attr>
	<Attr name="channels">2</Attr>
	<Attr name="derived_from">CityViews2 HD</Attr>
	<Attr name="frame_time">0.0400000000</Attr>
	<Attr name="frames">3425</Attr>
	<Attr name="height">1080</Attr>
	<Attr name="orig_name">CityViews2 HD</Attr>
	<Attr name="orig_type">3</Attr>
	<Attr name="sample_rate">48000</Attr>
	<Attr name="width">1920</Attr>
	<Attr name="first_frame">0</Attr>
	<Attr name="last_frame">3425</Attr>
	<Attr name="title">CityViews3</Attr>
	<Attr name="create_time">2018-03-27T10:26:30</Attr>
	<Attr name="rec_time">2016-12-17T16:15:14</Attr>
</Clip>

Retrieving XML Metadata Values

A certain XML field value may be retrieved in a following way:

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>/GETUSERFIELDS[?field=ns:name]

Receiving WebProxy

The request returns media data (MP4 or HLS).

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>[/PVW]/<WPN>

Examples

Retrieving the web proxy version (download by the link):

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>/WP1

Viewing the web proxy version (the link opens the file in a browser):

The <video controls=“true”></video> tag is used for displaying.

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>/PVW/WP1

Deleting Asset

DELETE http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>

Load XMP Metadata

Detailed description of the function of XMP metadata batch load to MAM via Metadata Connectors. Added in version 2.0.60.

PUT http://<IP_ADDR>:7901/storage/<NAME>?connector=<CONNECTOR_NAME>

Actions with Assets

POST http://<IP_ADDR>:7901/storage/<NAME>@<TITLE|NS:ID>?command=<COMMAND_NAME>[&param=val...]

Generating PNG Thumbnail for Asset

A request to retrieve a PNG thumbnail of the media asset (including parametrised graphics templates) for any specified frame. The request returns a PNG image. Added in version 2.3.63.

GET http://<IP_ADDR>:7901/storage/<NAME>@<TITLE>/GETICON[?[pos=FRM][&dur=FRM][&w=PX][&h=PX][&param=NAME:VAL[&param=NAME:VAL]]]

All parameters and values must be encoded to URL Encode if they contain any of the following special characters: ! * ‘ ( ) ; : @ & = + $ , / ? % # [ ].

Use the %0a character to create a new line:

http://127.0.0.1:7901/storage/Storage_1@g1/GETICON?param=Text:This%20is%20sample%20text%0anew%20line%20here

Use the “\\” и “\/“ escape sequence to pass a «\» or«/» character as a part of a clip title or folder name:

http://127.0.0.1:7901/storage/Storage_1@g%5c%2f1/GETICON?param=Text:This%20is%20sample%20text%0anew%20line%20here
http://127.0.0.1:7901/storage/Storage_1/qq%5c%2faa