Video Transcoding

Create a studio task

POST
https://peertube2.cpy.re/api/v1/videos/{id}/studio/edit

Create a task to edit a video (cut, add intro/outro etc). By default the video is edited in place. Set saveAsNewVideo to keep it untouched and save the result in a new video.

Body

multipart/form-data
tasksArray<object>required
Show child attributes
Any of
namestringcut
optionsobject
Show child attributes
startinteger
endinteger
namestringadd-intro
optionsobject
Show child attributes
filestring<binary>
namestringadd-outro
optionsobject
Show child attributes
filestring<binary>
namestringadd-watermark
optionsobject
Show child attributes
filestring<binary>
namestringremove-segments
optionsobject
Show child attributes
segmentsArray<object>required
Show child attributes
startinteger>= 0required
endinteger>= 1required
saveAsNewVideobooleanfalse

Keep the source video untouched: duplicate it, and edit the duplicate. The duplicate is created private, in the same channel as the source video, with the source video metadata. The size of the source video counts towards the user quota.

Parameters

idid | UUIDv4 | shortUUIDrequiredpath

The object id, uuid or short uuid

Response

successful operation, when saveAsNewVideo is true. Returns the identifiers of the new video

Response fields application/json
videoobject
Show child attributes
idid

object id for the video

Show child attributes
id>= 1
Example
42
uuidUUIDv4

universal identifier for the video, that can be used across instances

Show child attributes
UUIDv4<uuid>
Example
9c9de5e8-0a1e-484a-b099-e80766180a6d
shortUUIDshortUUID
Show child attributes

translation of a uuid v4 with a bigger alphabet to have a shorter uuid

shortUUID
Example
2y84q2MQUMWPbiEcxNXMgC
204No Content

successful operation, when the source video is edited in place

400Bad Request

incorrect parameters

403Forbidden

the user cannot manage this video, or saveAsNewVideo is true on a blocked video and the user cannot manage blocks

404Not Found

video not found

409Conflict

video is already being processed

Authorization

OAuth2oauth2

Authenticating via OAuth requires the following steps:

  • Have an activated account
  • Generate an access token for that account at /api/v1/users/token.
  • Make requests with the Authorization: Bearer <token> header
  • Profit, depending on the role assigned to the account

Note that the access token is valid for 1 day and is given along with a refresh token valid for 2 weeks.