Skip to content

Opencast API Services.

Requeriments

To use the Transrate Services you need an API user account with the appropiate permissions. You can ask for one by opening a Snow Ticket.

You can use the standard, available "studio-upload" workflow, that will encode the uploaded video in different qualities (360p, 480p, 720p, 1080p, 2160p), the "fast" workflow that will encode the video in one single standard quality (1080p), or set up your own custom Workflows.

To upload an event to the Opencast Transcoding Service you have two options:

  • Step by step ingest: Create a mediapackage through an api call, add the attachements (metadata, acls and video files) to the mediapackage, one by one, and finish/close the ingest by running a workflow (opencast tasks). This is the recomended way.

  • Single step ingest: Create a compressed zip file with the same content explained in the previous option and make a similar api call uploading one single zip file. The zip file will contain also an additional manifest.xml file that describes the attachements.

The files required by the mediapackage are:

  • One episode.xml file with metadata that describes the event such as title, authors, date and series.

  • One acl.xml file that will allow the user that makes the ingest to access the resulting resources and also other aditional users to watch, download or edit the content.

  • One or more video files.

In order to process your ingested media files you should own:

  • one workflow that describe the operations (encoding commands, qualities, ...) to perform over the source media files to be published (make available for downloading) later in any of the available publication channels. Workflows can be splitted in files and nested.

  • one or more encoding profiles that will set up the transcoding operation properties.

As mentioned, the TaaS service will provide you a standard workflow and encoding profiles for the studio-upload and fast encodings despite you can provide your own tuned ffmpeg commands.

You can also ingest a video from a url that will allow you to connect opencast directly with the source. This will replace the source for the addTrack end point.

Opencast API

Please use your assigned user/password with appropriate access rights.

The Opencast API is described in: Opencast REST Service Documentation

For the test environment you must replace the production hostname by: ocweb01-test2.cern.ch

Ingest endpoint

  • https://ocweb-prod.cern.ch/docs.html?path=/ingest

Example: https://ocweb-prod.cern.ch/ingest/createMediaPackage

Events endpoint

  • https://ocweb-prod.cern.ch/docs.html?path=/api/events

Event general state

  • https://ocweb-prod.cern.ch/api/events/{event_id}

Example: https://ocweb-prod.cern.ch/api/events/e9754fdb-b199-4663-b97c-c890aa2d6ec5

Event publications

  • https://ocweb-prod.cern.ch/api/events/{event_id}/publications

Or: * https://ocweb-prod.cern.ch/api/events/{event_id}?withpublications=true

Workflows endpoint

  • https://ocweb-prod.cern.ch/docs.html?path=/api/workflows

Workflow state

  • https://ocweb-prod.cern.ch/api/workflows/?filter=event_identifier:{event_id}

Workflow operations

  • https://ocweb-prod.cern.ch/api/workflows/170870?withoperations=true&withconfiguration=false

Workflow operations state

  • https://ocweb-prod.cern.ch/api/workflows/?withoperations=true&filter=event_identifier:{event_id}

Operations (WF definition)

Encoding profile

  • https://docs.opencast.org/r/9.x/admin/#workflowoperationhandlers/encode-woh/

Notifications

  • https://docs.opencast.org/r/9.x/admin/#workflowoperationhandlers/httpnotify-woh/

Example files:

You can download and run some examples.

Notes:

  • If you have chosen the "fast" workflow, it will encode one single resolution mp4 file. If you prefere different qualities, you must select "studio-upload".

  • It is very important that you include the acl.xml file in the mediapackage. Otherwise you will not be able to run the workflow, or access the files.

  • Demo video cds-test-00: https://download.blender.org/demo/movies/BBB/

  • See also: https://gitlab.cern.ch/collaborativeapps/opsdoc/-/blob/master/docs/Webcast-and-Recording/opencast/opencast-mediapackage-ingest.md

Links to other related documents

CDS Videos Workflow

Opencast CERN-CDS Encoding profiles

Full script example

Ingest from external video URL