/videos/create

Create a new video by sending metadata and requestion an upload URL.

Parameters

title (optional) : string

Title of the video.

tags (optional) : string

Tags for the video. Multiple tags should be comma-separated.

description (optional) : string

Description of the video.

author (optional) : string

Author of the video.

date (optional) : signed integer

Video publish date. Specifies UTC date and time (in Unix timestamp format) when the video should be available for streaming. If not specified, defaults to the video creation date and time.

expires_date (optional) : signed integer

Video publish expiration date. Specifies UTC date and time (in Unix timestamp format) when the video should stop being available for streaming. If not set opr set to empty string the video will be available indefinitely.

duration (optional) : float

Video duration in seconds. Should only be used if sourcetype is set to url.

trim_in_point (optional) : string

The timecode in point for trimming the source in the format HH:MM:SS.mmm, for example 03:02:45.106 for 3 hours, 2 minutes, and 45.106 seconds. If not specified and trim_out_point is specified, then the trim_in_point will automatically be set to 00:00:00.000. Likewise, if the value is out of bounds, then the trim_in_point will automatically be set to 00:00:00.000.

trim_out_point (optional) : string

The timecode out point for trimming the source in the format HH:MM:SS.mmm or 03:02:45.106 for 3 hours, 2 minutes, and 45.106 seconds. If not specified and trim_in_point is specified, then the trim_out_point will automatically be set to the duration of the original video. Likewise, if the value is out of bounds, then the trim_out_point will automatically be set to the duration of the original video.

link (optional) : string

The URL of the web page where this video is published.

sourcetype (optional) : string

Source type of the video:

file

Video with a file source type will be created

url

Video with an url source type will be created

Default is file.

sourceurl (optional) : string

URL of the video source. Required if sourcetype is set to url. If sourceformat is youtube, sourceurl can be specified as a full URL to the YouTube video or as an YouTube Video ID.

sourceformat (optional) : string

Video source format:

mp4

For videos with MIME type video/mp4.

webm

For videos with MIME type video/webm.

flv

For videos with MIME type video/flv.

aac

For audios with MIME type audio/aac.

mp3

For audios with MIME type audio/mpeg.

vorbis

For audios with MIME type audio/ogg.

m3u8

For a HLS M3U8 manifest URL.

smil

For a SMIL manifest URL.

mpd

For a DASH MPD URL.

rtmp

For an RTMP URL.

youtube

For an YouTube video.

Required if sourcetype is set to url.

download_url (optional) : string

URL from where to fetch a video file. Video file will be downloaded and processed on the server using this URL.

custom.param (optional) : string

User-defined parameter. param part of the request parameters (after the ‘.’ separator) specifies name of the parameter. Parameter name should adhere to the following naming rules:

  • name can contain letters, numbers and punctuation characters ‘.’, ‘_’, ‘-‘
  • name cannot start with a number or punctuation character
  • name cannot contain spaces
  • do not use reserved names for custom parameters, reserved names include: `file`, `tracks`, `sources`, `feedid`, `mediaid`, any existing non-custom parameter names ex: `title`, `description`, `author`, etc.

Warning

Using reserved names of for custom parameters may result in non-deterministic output from the Delivery API.

User-defined parameter can be specified multiple times, as far as parameter name is unique.

md5 (optional) : string

Video file MD5 message digest. If supplied and upload_method option is set to single, it will be compared with the MD5 digest calculated for the received video file. Uploaded video will be rejected if MD5 message digests do not match.

size (optional) : unsigned integer

Video file size. If supplied, it will be compared with the size of the received video file. Uploaded video will be rejected if the sizes do not match.

Warning

The maximum allowed video file size is 25 GiB.

upload_method (optional) : string

Video upload method:

single

Video will be uploaded as a single file.

The single file upload example shows how to use the single parameter.

multipart

Video will be uploaded in multiple parts using resumable protocol.

The multipart file upload example shows how to use the multipart parameter.

s3

Video will be uploaded as a single file to AWS S3.

The s3 file upload example shows how to use the s3 parameter.

Warning

S3 file uploads are limited to files less than 5GB in size. For larger files, a different upload method will need to be used.

Default is single.

upload_content_type (optional) : string

Specifies MIME type of the video file that will be uploaded. Applicable only if upload_method is set to s3. If MIME type provided, it will be used to generate S3 upload signature.

Example response (sourcetype == file)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <video key="tL17msiU">
    <link>
      <protocol>http</protocol>
      <address>upload.jwplatform.com</address>
      <path>/v1/videos/upload</path>
      <query>
        <key>vtQmcboj</key>
        <token>e2bbad0fd889d5d2e30047596cfe3789778257d2</token>
      </query>
    </link>
  </video>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//video/@key : string

Key of the created video.

//video/link/protocol : string

Protocol part of the upload URL.

//video/link/address : string

Address part of the upload URL.

//video/link/path : string

Path part of the upload URL.

//video/link/query/key : string

Upload key query parameter.

//video/link/query/token : string

Upload token query parameter.

Example response (sourcetype == url)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <video key="tL17msiU" />
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//video/@key : string

Key of the created video.

Example response (download_url is specified)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <video key="tL17msiU" />
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//video/@key : string

Key of the created video.

Example response (upload_method == multipart)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <video key="tL17msiU">
    <link>
      <protocol>http</protocol>
      <address>upload.jwplatform.com</address>
      <path>/v1/videos/upload/resumable</path>
      <query>
        <key>vtQmcboj</key>
      </query>
    </link>
    <session_id>kwJei9j2vtQmcbojrlGJY3mbJFMHfzZwPXBwoSQr</session_id>
  </video>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//video/@key : string

Key of the created video.

//video/link/protocol : string

Protocol part of the upload URL.

//video/link/address : string

Address part of the upload URL.

//video/link/path : string

Path part of the upload URL.

//video/link/query/key : string

Upload key query parameter.

//video/session_id : string

Resumable upload session ID.

Example response (upload_method == s3)

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>ok</status>
  <video key="tL17msiU">
    <link>
      <protocol>https</protocol>
      <address>upload-s3.jwplatform.com</address>
      <path>/tL17msiU</path>
      <query>
        <AWSAccessKeyId>AKIAIRXCJ3TPZA4HVNYZ</AWSAccessKeyId>
        <Expires>1482770374</Expires>
        <Signature>1/l+L6/yOE05dNEbXHW8sw7TGF4=</Signature>
      </query>
    </link>
  </video>
</response>

Response parameters

/response/status : string

Call execution status. Set to ok if call executed successfully.

//video/@key : string

Key of the created video.

//video/link/protocol : string

Protocol part of the upload URL.

//video/link/address : string

Address part of the upload URL.

//video/link/path : string

Path part of the upload URL.

//video/link/query/AWSAccessKeyId : string

AWS access key used to sign upload URL.

//video/link/query/Signature : string

Upload URL signature.

//video/link/query/Expires : string

UTC date and time (in Unix timestamp format) when signature expires.