post https://{app}.{filespin}.{io}/api/v1/assets//clip/process
You can make use of /clip/process
API to create custom transcodes to :-
- create a clip from specific section of a video
- add a custom watermark to a video other than the default watermark
The transcode output will be added as a conversion to the asset and stored in Video transcodes bucket specified in account settings. Webhook callback will be issued once output is created.
REQUEST JSON
Key | Value | Description |
---|---|---|
name | string | Conversion name. The transcode output will be named as name.mp4 , like clip_sample.mp4 |
preset | string | Any of the standard video transcode keys 360p-video , 360p-wm-video , 480p-video , 480p-wm-video , 720p-video , 720p-wm-video , 1080p-video , 1080p-wm-video |
start | integer or timecode string | (optional) Defaults to 0 . Seconds into the video for clip start. |
length | integer | (optional) Defaults to entire video. Length of clip in seconds |
public | boolean | (optional) Defaults to false . Make the output file public in Storage to allow playback using /transcodes API without signed URL |
aspect | string | (optional) Defaults to "pad". Determines aspect and padding. Can be "pad" - to add padding, "preserve" - preserves original aspect ratio, padding color will be ignored, "scale" - scales the output, "crop" - crops the output to match requested dimensions. |
padding | string | (optional) Defaults to 000000 - black. Padding color. Applies only when aspect is "pad". Value is a six character colorcode such as 000000 - black, ffffff - white, etc. |
upscale | boolean | (optional) Defaults to false . Upscale the output if original is of lower size than requested output size. |
watermark | object | (optional) Defaults to null . Add a watermark to the output. See below for details. |
watermark.url | string | (required) URL of the watermark image. Can be a public URL or an on-demand image URL of an asset in your account |
watermark.placement | string | (optional) Defaults to account watermark setting. Position of the watermark. Can be top-left , top-right , bottom-left , bottom-right or center |
watermark.scale | float | (optional) Defaults to account watermark setting. Scale of the watermark. Can range from 0 to 1 . 0.1 will scale the watermark to 10% of the output video size and place it at the specified placement, 0.5 will scale it to 50% of output video size. |
Note: If name provided is is the same as an existing conversion name, the existing conversion will be overwritten. For example, if asset already has a 480p-video conversion and this API is called with {"name": "480p-video"}, the existing conversion will be overwritten by the output of this processing.
Note:
- Transcode output will be added to Asset as a Conversion automatically using the given
name
key - Transcode output details can be retrieved using the
Get Data
API (see Asset Data Storyboard JSON example) - Transcode output is stored in Video Transcodes storage bucket specified in account settings
Once a processing completes, callbacks are issued to registered webhooks.
HTTP RESPONSE
Standard HTTP Status code - 202 or 200 and JSON response body as below:-
{
"status": "QUEUED",
"message": "Job queued",
"job_id": 42
}
Key | Value | Description |
---|---|---|
status | string | Status of the process. Can be QUEUED or ERROR |
message | string | Message describing the status |
job_id | integer | Job ID of the process. Can be used to query the status of job using Job Status API |