Brightcove™ Batch Provisioning Integration
Encoding.com has developed a special plug-in that enables Brightcove customers to take advantage of Encoding.com's advanced video encoding features. Utilizing the dozens of encoding controls (custom dimensions, bitrate, framerate, 1/2 pass, deinterlacing, etc.) available via the Encoding.com platform, Brightcove customers can now have complete control over their video transcoding and achieve superior quality without having to make an investment in expensive hardware / software solutions. The plug-in will automatically deliver the encoded video library to the Brightcove customer’s account (via the Brightcove™ FTP Batch Provisioning) along with the necessary meta data (media title, description, tags, etc.) and is available via Encoding.com’s powerful XML API thus enabling seamless integration into internal media workflows, applications and content management systems.Composing API request
First, add new elements to the AddMedia XML request:
<query>
<action>AddMedia</action>
<userid>xxx</userid>
<userkey>xxx</userkey>
<source>http://yoursite.com/media.mov</source>
<resend_to>http://manage.encoding.com/third_party/brightcove/add_media.php</resend_to>
<notify>http://manage.encoding.com/third_party/brightcove/add_manifest.php</notify>
<title>Your media title</title>
<description>Short description of the media</description>
<long_description>
Put
Long description
Of the Media Here
</long_description>
<bc_userid>12345</bc_userid>
<bc_mediaid>12345</bc_ mediaid>
<notify_email>user@mail.com</notify_email>
<link_title>Link title</link_title>
<link_url>http://encoding.com</link_url>
<active>true</active>
<tag>tag’s content</tag>
<format>
<output>flv</output>
<destination>ftp://user:password@ftp.brightcove.com/encoded/media.flv</destination>
</format>
</query>
This process will trigger our system to re-send the API request with <mediaid> element added to the specified URL. Then, the additional information will be
stored and associated with newly added media.
The manifest file format
If the media is encoded successfully, the other script specified in the <notify> element will compose and save XML manifest file with the same
name as your first result file, but with extension .xml, and to the same FTP folder as was specified in the first <destination>. The file will
have the following format (assume the result video format is FLV):
<publisher-upload-manifest publisher-id="{bc_userid}" preparer="encoding.com" report-success="TRUE">
<notify email="{notify_email}"/>
<asset filename="{result_filename}" refid="{result_filename}-{md5_hash}" size="{file_size}"
hash-code="{md5_hash}" type="FLV_FULL"/>
<title name="{title}" refid="{bc_mediaid}" active="{active}"
flash-full-refid="{result_filename}-{md5_hash}">
<short-description>{description}</short-description>
<long-description>{long_description}</long-description>
<related-link-url>{link_url}</related-link-url>
<related-link-text>{link_title}</related-link-text>
<rendition-refid>{result_filename}-{md5_hash}</rendition-refid>
<tag>tag’s content</tag>
</title>
</publisher-upload-manifest>
Where {file_size} and {md5_hash} will be calculated according to the result file. The asset nodes will be added only for the following
output values: flv, fl9, thumbnail.
Adding thumbnails
If a request contains a thumbnail generation task, <asset type="THUMBNAIL"> or <asset type="VIDEO_STILL"> will be added to the manifest. The
type attribute depends on the resulting image width: if it is less than 200 pixels, the type will be THUMBNAIL, otherwise it will be
VIDEO_STILL.
The request:
<output>flv</output>
<destination>ftp://user:password@ftp.brightcove.com/encoded/media.flv</destination>
</format>
<format>
<output>thumbnail</output>
<destination>ftp://user:password@ftp.brightcove.com/encoded/media_thumb.jpg</destination>
</format>
The manifest:
hash-code="896e665b84fd8b59ba8f5930dc61d21b" type="FLV_FULL"/>
<asset filename="media_thumb.jpg" refid="media_thumb.jpg-0861874e79d02a9cb17642defad47926" size="29863"
hash-code="0861874e79d02a9cb17642defad47926" type="THUMBNAIL"/>
<title name="{title}" refid="{bc_mediaid}" active="TRUE"
flash-full-refid=" media.flv-896e665b84fd8b59ba8f5930dc61d21b"
thumbnail-refid="media_thumb.jpg-0861874e79d02a9cb17642defad47926">
Selecting title ref-id from multiple records with equal formats
If there are several FLV or THUMNAIL tasks in the single request, the same number of <asset> elements will be added to the XML manifest.
Although, only the first task of each group will reflect to the title’s flash-full-refid or thumbnail-refid accordingly. So, if you want certain
task’s asset to reflect into the title, specify this task first in your XML API request.
Specifying different video's renditions
When you specify video frame size and bitrate in your API request, the additional attributes will be added to the appropriate assets in the
manifest file.
The request:
<output>flv</output>
<bitrate>300k</bitrate>
<size>320x240</size>
</format>
<format>
<output>flv</output>
<bitrate>750k</bitrate>
<size>640x480</size>
</format>
The manifest:
hash-code="896e665b84fd8b59ba8f5930dc61d21b" type="FLV_FULL"
frame-width="320" frame-height="240" encoding-rate="300000"/>
<asset filename="media2.flv" refid="media2.flv-90f044322653e205466de79d4534b84f" size="3542788"
hash-code="90f044322653e205466de79d4534b84f" type="FLV_FULL"
frame-width="640" frame-height="480" encoding-rate="750000"/>
…
And within the title:
<rendition-refid>media1.flv-896e665b84fd8b59ba8f5930dc61d21b</rendition-refid>
<rendition-refid>media2.flv-90f044322653e205466de79d4534b84f</rendition-refid>











