Skip to main contentIBM Video Streaming Developers

Trim a video

Get video playback start and end point

Returns video playback start and end point in seconds.

If video is not trimmed, it will return 0 as start point and the original end point.

GET https://api.video.ibm.com/videos/{video_id}/trim.json

Parameters

This request has no parameters.

Success response

Upon success a response with HTTP status “200 OK” is returned with the following key-value pairs under a trim key.

KEYTYPEDESCRIPTION
startnumberVideo is trimmed from this second
endnumberVideo is trimmed until this second

Example of a success response:

{
"trim": {
"start": 323,
"end": 252
}
}

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 UnauthorizedThe provided access token is missing, revoked, expired or malformed
404 Not Foundnot_foundChannel was not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Set trim

Set video playback start and end point in seconds. Trimming does not affect the original video file and these changes can be reverted as needed.

Unsaved auto-recorded videos will become saved when trimming them.

PUT https://api.video.ibm.com/videos/{video_id}/trim.json

Parameters

The parameters for the PUT request:

PARAMETERTYPEIMPORTANCEDESCRIPTION
startintegerREQUIREDTrim video from this second
endintegerREQUIREDTrim video until this second

Minimum trim length is 10 seconds.

Success response

Upon success, a response with HTTP status “204 No Content” is returned.

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
400 Bad Requestbad_requestInvalid start or end time (minimum trim length is 10 seconds)
401 Unauthorizedinvalid_tokenThe provided access token is missing, revoked, expired or malformed
403 Forbiddenlack_of_ownershipThe API user is not allowed to manage the given video
404 Not Foundnot_foundVideo was not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request

Remove trim

Remove trim settings from a video.

DELETE https://api.video.ibm.com/videos/{video_id}/trim.json

Parameters

This request has no parameters.

Success response

Upon success a response with HTTP status “200 OK” is returned.

Error responses

Possible error responses:

HTTP RESPONSE CODEERROR VALUEERROR CONDITIONS
401 UnauthorizedThe provided access token is missing, revoked, expired or malformed
404 Not Foundnot_foundVideo was not found
503 Service UnavailableThere is a temporary error on the server which makes it impossible to serve the request