This topic describes how to use the Media API to create, update, or delete videos in your Brightcove account using remote assets. In the standard procedure for creating videos in your Brightcove account, you upload video files, which then are maintained in Brightcove's system, together with their names, descriptions, tags, and other metadata. Under an alternative procedure, remote assets, you maintain your video files on your own or a third-party system and provide Brightcove with the URL of the video file when you create the video. Using the remote assets approach, you can still edit and manage your videos using the Brightcove Studio, FTP batch provisioning, or the Brightcove Media API.
You can instead use FTP batch provisioning to create, update, or delete videos in your Brightcove account using remote assets.
All of your remote asset files must be available at a public URL, without any requirements for authentication or access control. If your remote assets are hosted by a CDN, the URL of remote assets should be the URL of the assets in the CDN and not the URL on the origin server.
To create a video using a remote asset video file, use the create_video method. Instead of uploading a video file by passing a video with a filename (or a video file in the file part of the POST) in the create_video method, pass the URL to one or more video files in the renditions field of the video. In the Rendition objects that you pass in the renditions field of the video, set the remoteUrl.
As an alternative, you can pass a single Rendition object in the videoFullLength field of the video. Again, you need to set the remoteUrl property in the Rendition object.
If your remote assets are served by streaming, rather than progressive download, you need to be sure to specify both the remoteUrl and the remoteStreamName properties of your Renditions. For example, if your file's full streaming URL is rtmp://flv.example.com/flash/streams/myDir/streamName.flv, set the remoteUrl property to the connect URL, like this:
remoteUrl="rtmp://flv.example.com/flash/"
and set the remoteStreamName attribute to the stream name, like this:
remoteStreamName="streams/myDir/streamName"
omitting the .flv file suffix.
Note: If you create a video using a streaming remote video file, you cannot use the Brightcove image capture tool to create still images from the video.
For example, you can create a video with remote streaming assets and two renditions by passing JSON like this:
{"method": "create_video",
"params": {"token" : "riBfgveLvpRb-rHGiBBouSAXs-Q8NmphGxt0z04kE.",
"video" : {
"name":"robins",
"shortDescription":"this is also required",
"renditions":[
{"referenceId": "Robins Low",
"remoteUrl": "rtmp:\/\/flv.example.com\/flash\/",
"remoteStreamName": "streams\/myDir\/RobinsLow", "size": 408122,
"videoDuration": 130122, "videoCodec": "ON2" }
{"referenceId": "Robins High",
"remoteUrl": "rtmp:\/\/flv.example.com\/flash\/",
"remoteStreamName": "streams\/myDir\/RobinsHigh", "size": 710812,
"videoDuration": 130122, "videoCodec": "ON2" }
]}}}
Note that since this video uses streaming video, we pass both the remoteUrl and the remoteStreamName in each rendition.
In this example, we use the videoFullLength property of the video to create a video with a single rendition that is delivered by progressive download:
{"method": "create_video",
"params": {"token" : "riBfgveLvpRb-rHGiBBouSAXs-Q8NmphGxt0z04kE.",
"video" : {
"name": "robins,"
"shortDescription":"this is also required",
"videoFullLength":
{"referenceId": "Robins Low",
"remoteUrl": "http:\/\/flv.example.com\/flash\/Robins.flv",
"size": 408122, "videoDuration": 130122, "videoCodec": "ON2" }
}}}