Core Concepts
This section contains concepts that should be understood before proceeding, as well as examples of typical queries and mutations. As we developed our platform, we tried to adhere to the GraphQL Best Practices.
Note: Some mutations don't return a result immediately, so you have to check for a status change.
1. Table of Contents
- Locators
- Organizations
- Paginated Results
- Workflows
- Tasks
- Media Items
- Assets
- Composition Playlists
- MediaWarp
- Packages
- Platforms
- Transcoding
- Clips
2. Locators
We created locators as a way to gather the necessary information to access files on different types of storage. The following locator types can be used:
S3FileLocator
- identify a file stored in an S3 bucketS3ImageSequenceFileLocator
- identify the reference file of an image sequence stored in an S3 bucketHttpFileLocator
- identify a file stored on a server through the HTTP protocolTransferFileLocator
- identify a file stored on a server through the FTP/SFTP/Aspera protocolFsFileLocator
- identify a file on local storage
S3FileLocator Example
The S3FileLocator must contain the following fields:
type
- the type of locator;bucket
- the URL of the S3 bucket that contains the targeted file;key
- the folder path to the targeted file.
The following is an example variable definition for an S3Locator:
{
"type":"S3FileLocator",
"key":"content/VIDEO_a6474c76-b8a5-4b3c-9386-a492638dc7e4.mxf",
"bucket":"connect.ownzones.dev"
}
3. Organizations
Organizations are spaces used to separate content between different departments or projects. Media included in an organization is not visible in any other (provided that storage is configured differently).
Viewing Organizations
To get a list of organizations available to the authenticated user:
Query
query ListAllOrganizations {
allOrganizations {
id
name
parentId
}
}
Result
{
"data": {
"allOrganizations": [
{
"id": "4c312239-1258-4fd5-bbd2-698a2d32221d",
"name": "System Organization",
"parentId": null
},
{
"id": "3d89775d-0417-4767-b7a0-6d5b98204c3a",
"name": "AMP",
"parentId": null
},
{
"id": "a7e58d62-a6ee-4c9e-ae66-e63d2bf85e5b",
"name": "AMP Ext",
"parentId": "a67c108d-01d1-427a-b74f-4d20a929c24b"
},
{
"id": "f300eabe-b4ed-4380-b21a-92581c2b0f5e",
"name": "SNK",
"parentId": null
}
]
}
}
4. Paginated Results
Whenever you have lists of items to display or retrieve (such as getting a list of assets), you can loop through them in "pages", by using the first
and skip
parameters:
first
- the number of results retrieved at once ;skip
- the number of results that are skipped before displaying a number offirst
results.
For example, if the number of assets (also shown by the totalCount
parameter) is 100 and you want to display 20 at a time:
- set the first
variable to 20
- for the first query, set the skip
variable to 0;
- for the second query, set the skip
variable 20.
Subsequent queries are multipliers of the iteration counter and the first
variable: $skip=COUNTER*$first
.
Query
query ListAssets($first: Int, $skip:Int) {
assets(first: $first, skip: $skip) {
edges {
node {
id
}
}
}
}
Variables
{
"first":5,
"skip":0
}
Result
{
"data": {
"assets": {
"edges": [
{
"node": {
"id": "0ca35f46-a0ac-4705-9897-8e11cc898d09"
}
},
{
"node": {
"id": "a3b1dbd3-181f-4a32-bad9-04bfd6b4306c"
}
},
{
"node": {
"id": "09161f5d-d612-46c5-a4b7-5513c2dbf93f"
}
},
{
"node": {
"id": "722f02ce-0fda-4cce-9f00-e84fba999cb9"
}
},
{
"node": {
"id": "d94382dc-5212-446d-b666-2b9c25bc852b"
}
}
]
}
}
}
5. Workflows
Workflows are groups of Tasks with dependencies between them, as part of a larger process.
Note: For example, an Ingest Workflow for a timed text track contains the Ensure Access and Probing Media tasks (EnsureAccessTask and TimedTextTask respectively).
Viewing Workflow Details
To view a worfklow's details, run the following query:
Query
query ReadWorkflow($id: ID!) {
workflow(id: $id) {
id
name
type
asset {
id
name
}
package {
id
name
}
status
createdAt
startedDate
finishedDate
createdBy {
id
name
}
progress
tasks {
id
type
... on ProbeTask {
args {
file {
id
filename
}
}
}
... on TranscodeTask {
args {
mediaContainerFile {
id
filename
}
}
}
... on CopyTask {
args {
sourceFile {
id
filename
}
}
}
... on ConcatTask {
args {
sourceFiles {
id
filename
}
}
}
... on DemuxTask {
args {
inputFiles {
id
filename
}
}
}
... on InterlaceScanTask {
args {
sourceFile {
id
filename
}
}
}
... on WaitForIngestTask {
args {
files {
id
filename
}
}
}
... on HashTask {
args {
file {
id
filename
}
}
}
... on DrawTextTask {
args {
sourceFile {
id
filename
}
}
}
}
}
}
Variables
{
"id": "6d2cdcf9-207b-4510-9c20-75c3e1c51536"
}
Result
{
"data": {
"workflow": {
"id": "6d2cdcf9-207b-4510-9c20-75c3e1c51536",
"name": "Ingest",
"type": "IngestWorkflow",
"asset": null,
"package": null,
"status": "completed",
"createdAt": null,
"startedDate": "2019-05-21T12:32:25.120Z",
"finishedDate": "2019-05-21T12:32:30.763Z",
"createdBy": null,
"progress": 100,
"tasks": [
{
"id": "ad7e71b0-f071-435d-a6bc-44ec80f1d2a1",
"type": "EnsureAccessTask",
},
{
"id": "4a087ef8-5a5d-4bde-b38c-04a558392002",
"type": "ProbeTask",
"args": {
"file": {
"id": "ba992a8c-6f39-4727-bd73-b4801bc6b3dc",
"filename": "Meridian_CC.cap",
},
},
},
{
"id": "fced137b-29db-4bec-9648-bb76086b6ea5",
"type": "TimedTextTask",
},
{
"id": "09e0ff8a-fea0-4977-aba9-9fdf9afb3db8",
"type": "HashTask",
"args": {
"file": {
"id": "ba992a8c-6f39-4727-bd73-b4801bc6b3dc",
"filename": "Meridian_CC.cap",
},
},
}
],
}
}
}
6. Tasks
Tasks represent the smallest unit of work that is performed to fulfill a Workflow, such as copying files, awaiting to finish ingesting files, validate access, awaiting for review etc.
Viewing Workflow Tasks
To view tasks of a workflow:
Query
query ReadWorkflow($id: ID!) {
workflow(id: $id) {
id
domain
status
tasks {
id
status
progress
startedDate
finishedDate
error {
name
message
}
... on CopyTask {
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
targetFile {
id
fileLocator { url }
}
targetFileLocator { url }
}
}
... on ConcatTask {
args {
sourceFiles {
id
fileLocator { url }
}
targetFile {
id
fileLocator { url }
}
targetFileLocator { url }
}
}
... on TranscodeTask {
elementalJobUrl
mediaConvertJobUrl
hybrikJobUrl
args {
mediaContainerFile {
id
fileLocator { url }
}
captionFile {
id
fileLocator { url }
}
bugFile {
id
fileLocator { url }
}
targetFile {
id
fileLocator { url }
}
targetFileLocator { url }
transcoderProfile {
id
name
platformId
}
}
}
... on TransformCaptionTask {
args {
frameRate
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
targetFile {
id
fileLocator { url }
}
targetFileLocator { url }
}
}
... on ThumbnailTask {
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
targetFiles {
id
fileLocator { url }
}
targetFileLocators { url }
thumbnailWidth
thumbnailHeight
}
}
... on DemuxTask {
args {
inputStreamIndices
inputFiles {
id
fileLocator { url }
}
inputFileLocators { url }
outputFile {
id
fileLocator { url }
}
outputFileLocator { url }
}
}
... on BuildCplTask {
args {
output {
type
url
... on S3FileLocator {
key
bucket
}
}
}
}
... on BuildImfMetaTask {
args {
packingListFileLocator { url }
assetMapFileLocator { url }
itemFileLocators { url }
}
}
... on WaitForIngestTask {
args {
files {
id
fileLocator { url }
}
fileLocators { url }
}
}
... on GenerateMetadataTask {
args {
targetFile {
id
fileLocator { url }
}
targetFileLocator { url }
}
}
... on RunBatonJobTask {
jobId
qcProfile {
id
name
}
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
reportFile {
id
downloadUrl
}
}
}
... on PhotonQCTask {
qcProfile {
id
name
}
args {
package {
id
name
}
reportFile {
id
downloadUrl
}
}
}
... on InterlaceScanTask {
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
}
}
... on CropDetectionTask {
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
}
}
... on FrameScanTask {
args {
sourceFile {
id
fileLocator { url }
}
sourceFileLocator { url }
}
}
... on OwnzonesExportTask {
args {
fileUrl
feedId
}
}
... on ReverseTranscodeTask {
args {
action
sourceFile {
id
fileLocator { url }
}
targetFile {
id
fileLocator { url }
}
}
}
... on SyncAssetMapTask {
args {
sourceFiles {
id
filename
}
assetId
}
}
... on DrawTextTask {
args {
sourceFileLocator { url }
destinationFileLocator { url }
text
fontSize
positionX
positionY
}
}
... on ExtractCaptionTask {
args {
outputFileLocators { url }
}
}
... on ExtractDoviMdTask {
args {
fileId
}
}
... on UpdateFilesTask {
args {
assetId
fileLocators { url }
}
}
... on AssociateMediaFilesTask {
args {
demuxedFilesLocators { url }
}
}
... on GenerateCplTask {
args {
asset {
id
name
}
urnEidr
originalLanguage
}
cplFile {
id
filename
}
}
... on MMCMetadataTask {
args {
definition
targetFile {
id
fileLocator { url }
}
}
}
... on WaitForClipsReviewTask {
args {
fileIds
workflowId
}
}
... on EnsureAccessTask {
args {
files {
id
fileLocator { url }
}
fileLocators { url }
}
}
... on BulkOperationTask {
args {
params {
oldBatchId
}
}
}
... on CloudStudioTask {
args {
fcpFile {
id
fileLocator { url }
}
sourceFile {
id
fileLocator { url }
}
proxyFile {
id
fileLocator { url }
}
presetFile {
id
fileLocator { url }
}
outputFile {
id
fileLocator { url }
}
}
}
}
}
}
Variables
{
"id": "6d2cdcf9-207b-4510-9c20-75c3e1c51536"
}
Result
{
"data": {
"workflow": {
"id": "6d2cdcf9-207b-4510-9c20-75c3e1c51536",
"domain": "connect.ownzones.dev20190520091300013100000005",
"status": "completed",
"tasks": [
{
"id": "ad7e71b0-f071-435d-a6bc-44ec80f1d2a1",
"status": "completed",
"progress": 100,
"startedDate": "2019-05-21T12:32:25.120Z",
"finishedDate": "2019-05-21T12:32:25.212Z",
"error": null,
"args": {
"files": [
{
"id": "ba992a8c-6f39-4727-bd73-b4801bc6b3dc",
"fileLocator": {
"url": "s3://connect.ownzones.dev/content/Meridian_cc.cap"
}
}
],
"fileLocators": [
{
"url": "s3://connect.ownzones.dev/content/Meridian_cc.cap"
}
]
}
},
{
"id": "4a087ef8-5a5d-4bde-b38c-04a558392002",
"status": "completed",
"progress": 100,
"startedDate": "2019-05-21T12:32:25.217Z",
"finishedDate": "2019-05-21T12:32:26.236Z",
"error": null
},
{
"id": "fced137b-29db-4bec-9648-bb76086b6ea5",
"status": "completed",
"progress": 100,
"startedDate": "2019-05-21T12:32:26.285Z",
"finishedDate": "2019-05-21T12:32:28.500Z",
"error": null
},
{
"id": "09e0ff8a-fea0-4977-aba9-9fdf9afb3db8",
"status": "completed",
"progress": 100,
"startedDate": "2019-05-21T12:32:28.505Z",
"finishedDate": "2019-05-21T12:32:30.758Z",
"error": null
}
]
}
}
}
7. Media Items
Media Items represent any type of file: image, video, audio, metadata etc. Media items can be included in assets, used as CPL resources, or processed and delivered individually (transcode, reverse transcode, convert captions, copy etc).
Getting the ID and Locator of a Media Item
To find a media item by name, run the following query:
Query
query findMedia($file: String) {
files(search: $file) {
edges {
node {
id
filename
fileLocator { url }
}
}
}
}
Variables
{
"file": "meridian"
}
Note: Searching for a media item by name can return multiple results; as such, we recommend being as specific as possible when searching for a file name. Keep in mind that you can also use folder names from the file path in the search terms.
Result
{
"data": {
"files": {
"edges": [
{
"node": {
"id": "2af2c4c7-b168-4ef1-93e9-6cd8a4b3f40c",
"filename": "meridian.mov",
"fileLocator": {
"url": "s3://connect.ownzones.dev/content/meridian.mov"
}
}
}
]
}
}
}
Ingesting Media Items
To ingest or re-ingest a media item, run the following mutation (provided you know the id of the media item - see Find Media Item):
Mutation
mutation IngestFile($id: ID!) {
ingestFile(id: $id) {
id
ingestWorkflow {
id
}
}
}
Variables
{
"id": "2af2c4c7-b168-4ef1-93e9-6cd8a4b3f40c"
}
Result
{
"data": {
"ingestFile": {
"id": "2af2c4c7-b168-4ef1-93e9-6cd8a4b3f40c",
"ingestWorkflow": {
"id": "4603c6bd-a9b8-44bd-ba06-ecac94142059"
}
}
}
}
8. Assets
Assets are media item containers, that allow you to manage, package, and deliver media.
Viewing all Assets
To list all assets from the current organization:
Query
query ListAssets {
assets {
edges {
node {
id
name
createdBy {
name
}
}
}
}
}
Result
{
"data": {
"assets": {
"edges": [
{
"node": {
"id": "58706c9a-7790-4140-84dd-ec0129df80fb",
"name": "Meridian Asset 1",
"createdBy": {
"name": "User1"
}
}
},
{
"node": {
"id": "2c81706d-e452-4130-ac51-f0c966f80020",
"name": "Meridian Asset 2",
"createdBy": {
"name": "User2"
}
}
}
]
}
}
}
Getting the ID of an Asset
So search for an asset by name and retrieve its id:
Query
query GetAssetId {
assets(filters: {name: {like: "meridian asset"}}) {
edges {
node {
id
name
createdBy {
name
}
}
}
}
}
Result
{
"data": {
"assets": {
"edges": [
{
"node": {
"id": "7c996a50-98a3-415a-a321-fdb699b2d682",
"name": "Meridian Asset 1",
"createdBy": {
"name": "User 1"
}
}
}
]
}
}
}
Creating an Asset
To create an asset:
Mutation
mutation CreateAsset ($input: AssetInput) {
createAsset(input: $input) {
id
}
}
Variables
{
"input": {
"name": "New Asset"
}
}
Result
{
"data": {
"createAsset": {
"id": "29e0e5ea-d7e0-404b-bd88-4eefd0f6b8c8"
}
}
}
Attaching Media Items
To attach a media item to an asset:
Mutation
mutation AssignFile($id: ID!, $input: FileInput) {
updateFile(id: $id, input: $input) {
id
}
}
Variables
{
"input": {
"assetId": "52a9526b-0db2-4065-b82a-5afefc23e340"
},
"id": "f79e17da-c642-402f-90c8-8c7fad92a7fb"
}
Result
{
"data": {
"updateFile": {
"id": "f79e17da-c642-402f-90c8-8c7fad92a7fb"
}
}
}
We recommend validating that the media item was attached to the asset, by querying to see the assetId
field of the media item.
Query
query checkAssetId($id:ID){
files(filters: {id: {eq: $id}}) {
edges{
node {
id
assetId
}
}
}
}
Result
{
"data": {
"files": {
"edges": [
{
"node": {
"id": "2af2c4c7-b168-4ef1-93e9-6cd8a4b3f40c",
"assetId": "5766a638-b2cc-4574-9130-eb57251a93b7"
}
}
]
}
}
}
Deleting an Asset
To delete an asset:
Getting the Asset ID
query GetAssetId {
assets {
filters: {
name: {
like: "meridian asset"
}
}
}
{
edges {
node {
id
name
}
}
}
}
Mutation
mutation DeleteAsset ($id: ID!) {
deleteAsset(id: $id) {
id
}
}
Variables
{
"id": "29e0e5ea-d7e0-404b-bd88-4eefd0f6b8c8"
}
Result
{
"data": {
"deleteAsset": null
}
}
9. Composition Playlists
Composition Playlists (CPLs) are used for working with IMF and they define and orchestrate the playback of referenced media items, either partial or full.
Viewing CPLs from an Asset
To list all CPLs associated with an asset:
Query
query ListFiles($first: Int, $skip: Int, $search: String, $filters: FileFilters, $orderBy: [FileOrderBy]) {
files(first: $first, skip: $skip, search: $search, filters: $filters, orderBy: $orderBy) {
edges {
node {
id
assetId
filename
language
createdAt
...FileName
...FileDesignations
...FileApplicationType
}
}
totalCount
}
}
fragment FileName on File {
id
assetId
type
filename
fileLocator { url }
}
fragment FileDesignations on File {
id
type
imfEssenceType
fileDesignations {
edges {
node {
id
}
}
}
}
fragment FileApplicationType on File {
id
properties {
... on MetadataProperties { applicationType }
}
}
Variables
{
"filters": {
"assetId":{
"eq":"cfbc789d-4f63-4c10-b4b7-f3f1ef5f21b6"
},
"imfEssenceType":{
"eq":"imf_cpl"
},
"origin":{
"eq":"source"
}
}
}
Result
{
"data": {
"files": {
"edges": [
{
"node": {
"id": "f786bf7e-f912-4aa9-9d92-2bd3b3f53eeb",
"assetId": "cfbc789d-4f63-4c10-b4b7-f3f1ef5f21b6",
"filename": "CPL___HD_null_bt709_prores_23_pcm_s24le_48K_1__.xml",
"language": null,
"createdAt": "2019-05-27T16:28:09.111Z",
"type": "metadata",
"fileLocator": {
"url": "s3://connect.ownzones.dev/content/CPL___HD_null_bt709_prores_23_pcm_s24le_48K_1__.xml"
},
"imfEssenceType": "imf_cpl",
"fileDesignations": {
"edges": []
},
"properties": {
"applicationType": "App2"
}
}
},
{
"node": {
"id": "9f8b6c02-783b-4519-a5cb-6c6d528c3178",
"assetId": "cfbc789d-4f63-4c10-b4b7-f3f1ef5f21b6",
"filename": "CPL___HD_169_bt709_jpeg2000_23_pcm_s24le_48K_6__30ba9521-eee5-4391-967a-c6702b28ac7d.xml",
"language": null,
"createdAt": "2019-05-24T08:34:17.589Z",
"type": "metadata",
"fileLocator": {
"url": "s3://connect.ownzones.dev/content/CPL___HD_169_bt709_jpeg2000_23_pcm_s24le_48K_6__30ba9521-eee5-4391-967a-c6702b28ac7d.xml"
},
"imfEssenceType": "imf_cpl",
"fileDesignations": {
"edges": []
},
"properties": {
"applicationType": "App2"
}
}
}
],
"totalCount": 2
}
}
}f
10. MediaWarp
MediaWarp is used extensively when working with IMF. By defining a MediaWarp Profile, you can extract essences from source media items based on your settings, as well as define how CPLs will be generated throughout the platform.
Viewing MediaWarp Profile Details
To view the details of a MediaWarp Profile:
Query
query ReadDemuxProfile($id: ID!) {
demuxProfile(id: $id) {
id
name
properties
files {
id
type
placement
order
repeatCount
fileId
tone
}
slateTemplate
cplSlateTemplate
slateProperties {
fontSize
positionX
positionY
lineSpacing
}
outputProperties {
frameRate
timecode
tcPassThru
chromaSubsampling
bitDepth
pixelFormat
profile {
type
mainlevel
sublevel
}
}
}
}
Variables
{
"id": "de8e852c-e37e-47c2-a1df-8fe3a62099e9"
}
Result
{
"data": {
"demuxProfile": {
"id": "de8e852c-e37e-47c2-a1df-8fe3a62099e9",
"name": "422Proxy 23.97fps",
"properties": null,
"files": [],
"slateTemplate": null,
"cplSlateTemplate": null,
"slateProperties": null,
"outputProperties": {
"frameRate": "24000/1001",
"timecode": null,
"tcPassThru": null,
"chromaSubsampling": null,
"bitDepth": null,
"pixelFormat": null,
"profile": {
"type": "422PROXY",
"mainlevel": null,
"sublevel": null
}
}
}
}
}
Retrieving Recommended MediaWarp Parameters
You can use the suggestDemux
query to retrieve recommended parameters for the specified media item, to make it easier to fill in the variables and run MediaWarp.
Query
query SuggestDemuxQuery($fileId: ID!) {
file(id: $fileId) {
id
assetId
type
tracks {
id
type
index
properties {
... on VideoTrackProperties {
frameRateNominator
frameRateDenominator
}
... on AudioTrackProperties {
channels
sampleRate
}
}
}
}
suggestDemux(fileId: $fileId) {
inputFileId
demuxProfileId
errors
outputs {
... on ImageDemuxOutputOptions {
type
outputLocator {
type
url
... on S3FileLocator { bucket }
}
inputStreamIndex
outputFileId
}
... on AudioDemuxOutputOptions {
type
outputLocator {
type
url
... on S3FileLocator { bucket }
}
layout
channelsMapping {
streamIndex
streamId
channels {
channelIndex
channelLabel
}
}
language
outputFileId
}
... on TimedTextDemuxOutputOptions {
type
outputLocator {
type
url
... on S3FileLocator { bucket }
}
language
outputFileId
inputStreamIndex
}
}
outputCplLocator {
type
url
... on S3FileLocator { bucket }
}
}
}
Variables
{
"fileId": "90bd6da9-2331-497d-b512-30bcb5130a5e"
}
Result
{
"data": {
"file": {
"id": "90bd6da9-2331-497d-b512-30bcb5130a5e",
"assetId": null,
"type": "media_container",
"tracks": [
{
"id": "5439bc40-d550-4c0b-adea-99d7a52bd52d",
"type": "video",
"index": 0,
"properties": {
"frameRateNominator": 30,
"frameRateDenominator": 1
}
},
{
"id": "eae1c2f8-1e3f-47a8-984d-62f5718beba7",
"type": "audio",
"index": 1,
"properties": {
"channels": 2,
"sampleRate": 48000
}
}
]
},
"suggestDemux": {
"inputFileId": "90bd6da9-2331-497d-b512-30bcb5130a5e",
"demuxProfileId": "dbae318f-3e04-4017-b26f-769e1fa9dcd4",
"errors": [],
"outputs": [
{
"type": "image",
"outputLocator": {
"type": "S3FileLocator",
"url": "s3://connect.ownzones.dev/content/326dacb7-1746-42fe-8b56-e670e28837ce_j2k__video.mxf",
"bucket": "connect.ownzones.dev"
},
"inputStreamIndex": 0,
"outputFileId": "326dacb7-1746-42fe-8b56-e670e28837ce"
},
{
"type": "audio",
"outputLocator": {
"type": "S3FileLocator",
"url": "s3://connect.ownzones.dev/content/a193691d-0143-44b3-bd95-2a7b5ce0fc3d_pcm_20__audio.mxf",
"bucket": "connect.ownzones.dev",
},
"layout": "stereo",
"channelsMapping": [
{
"streamIndex": "1",
"streamId": null,
"channels": [
{
"channelIndex": "0",
"channelLabel": "FL"
},
{
"channelIndex": "1",
"channelLabel": "FR"
}
]
}
],
"language": "en",
"outputFileId": "a193691d-0143-44b3-bd95-2a7b5ce0fc3d"
}
],
"outputCplLocator": {
"type": "S3FileLocator",
"url": "s3://connect.ownzones.dev/content/CPL___h264_aac_2__.xml",
"bucket": "connect.ownzones.dev"
}
}
}
}
Creating a MediaWarp Profile
To create a simple MediaWarp Profile:
Mutation
mutation CreateDemuxProfile($input: DemuxProfileInput!) {
createDemuxProfile(input: $input) {
id
}
}
Variables
{
"input":{
"name":"422HQ 24fps",
"files":[],
"outputProperties":{
"frameRate":"24",
"profile":{
"type":"422HQ",
"mainlevel":null,
"sublevel":null
}
}
}
}
Result
{
"data": {
"createDemuxProfile": {
"id": "25cff059-8cfa-4b81-b4ad-e337a75af630"
}
}
}
Starting MediaWarp
To start MediaWarp and extract Image and Audio essences from a specific media item:
Mutation
mutation RunMediaWarp($options: DemuxOptionsInput) {
demuxFile(options: $options) {
id
type
tasks {
id
type
}
validationErrors {
type
}
}
}
Variables
{
"options": {
"inputFileId": "98b09671-62da-4b60-ae3b-a00279a8af9e",
"outputs": [
{
"type": "image",
"outputFileId": "e9acfb51-bea5-4f65-87d1-b8a6be063f5f",
"outputLocator": {
"type": "S3FileLocator",
"bucket": "connect.ownzones.dev",
"key": "content/e9acfb51-bea5-4f65-87d1-b8a6be063f5f_j2k__video.mxf"
},
"inputStreamIndex": 0
},
{
"type": "audio",
"outputFileId": "c3af4d8f-48d9-41c2-81f2-6d747503f9dc",
"outputLocator": {
"type": "S3FileLocator",
"bucket": "connect.ownzones.dev",
"key": "content/c3af4d8f-48d9-41c2-81f2-6d747503f9dc_pcm_20__audio.mxf"
},
"language": "en",
"layout": "stereo",
"channelsMapping": [
{
"fileId": "98b09671-62da-4b60-ae3b-a00279a8af9e",
"streamIndex": 1,
"channels": [
{
"channelIndex": 0,
"channelLabel": "FL"
}
]
},
{
"fileId": "98b09671-62da-4b60-ae3b-a00279a8af9e",
"streamIndex": 1,
"channels": [
{
"channelIndex": 1,
"channelLabel": "FR"
}
]
}
]
}
],
"outputCplLocator": null,
"demuxProfileId": "7b0ca33d-e36c-4685-b0ce-5f085009b197"
}
}
Result
{
"data": {
"demuxFile": {
"id": "4f5df2ba-5429-40c9-be55-a1e0dfbd1e14",
"type": "DemuxWorkflow",
"tasks": [
{
"id": "465e9871-3b3f-4c54-ab39-b051894d35cd",
"type": "DemuxTask"
},
{
"id": "7fc8167c-e9b5-4140-9b2a-271c8a13c502",
"type": "DemuxTask"
}
],
"validationErrors": null
}
}
}
11. Packages
Packages are groups of deliverables of the following types:
- Classic - flat media items
- IMF - MXF media items, along with the CPL, PKL, OPL, ASSETMAP.xml, and VOLINDEX.xml files
Listing Packages from an Asset
To list the first 3 packages from a specific asset:
Query
query ListPackages($first: Int, $skip: Int, $search: String, $filters: PackageFilters) {
packages(first: $first, skip: $skip, search: $search, filters: $filters, orderBy: [{fieldName: createdAt, direction: DESC}]) {
totalCount
edges {
node {
id
name
type
transcoderProfile {
id
name
}
basePackage {
id
name
}
job {
id
name
}
packageTemplate {
id
name
}
buildWorkflow {
id
status
}
targetDirectoryLocator { url }
}
}
}
}
Variables
{
"filters": {
"assetId":{
"eq":"07a7a67f-04be-4f6b-afc7-eca149ee3199"
}
},
"first":3,
"skip": 0
}
Result
{
"data": {
"packages": {
"totalCount": 24,
"edges": [
{
"node": {
"id": "b6c63fe1-5528-40e7-883c-d8ab5f8d73c2",
"name": "Meridian Full IMF",
"type": "imf",
"transcoderProfile": null,
"basePackage": null,
"job": null,
"packageTemplate": null,
"buildWorkflow": {
"id": "b09deb16-4b68-43f2-9620-16e1490060a8",
"status": "completed"
},
"targetDirectoryLocator": {
"url": "s3://connect.ownzones.dev/content/packages"
}
}
},
{
"node": {
"id": "887b105f-b079-4166-a143-e80bd14896e2",
"name": "Meridian Master Flat",
"type": "classic",
"transcoderProfile": null,
"basePackage": null,
"job": null,
"packageTemplate": {
"id": "a8aa4dcf-44a2-4c63-b91a-1b9bbb7602bc",
"name": "Flat Delivery"
},
"buildWorkflow": {
"id": "c352c0ac-c702-482a-bda4-6e5cb8c13bc9",
"status": "pending"
},
"targetDirectoryLocator": {
"url": "s3://connect.ownzones.dev/content/packages"
}
}
},
{
"node": {
"id": "2aa90b3f-d184-4390-b241-970a25fa584f",
"name": "Meridian Trailer Flat",
"type": "classic",
"transcoderProfile": null,
"basePackage": null,
"job": {
"id": "b89d8c32-fd02-42d5-9e8e-cfe53b8adff4",
"name": "Job1_Flat Delivery"
},
"packageTemplate": {
"id": "a8aa4dcf-44a2-4c63-b91a-1b9bbb7602bc",
"name": "Flat Delivery"
},
"buildWorkflow": {
"id": "7303ff5b-8f11-419b-acda-94b326624dd1",
"status": "pending"
},
"targetDirectoryLocator": {
"url": "s3://connect.ownzones.dev/content/packages"
}
}
}
]
}
}
}
Viewing Package Details
Package Details contain multiple groups of data: - basic information about the package - workflow information - automated QC - delivery history - a list of child packages - a list of flat packages
To retrieve information about a specific package:
Query
query ReadPackage($id: ID!) {
package(id: $id) {
id
name
qcStatus
createdAt
slug
packageTemplateId
jobId
job {
id
status
buildWorkflow {
id
status
}
}
type
assetId
asset {
id
name
metadataSets {
edges {
node {
id
name
errors
}
}
}
}
buildStatus
basePackage {
id
}
buildWorkflow {
id
status
}
}
}
Variables
{
"id": "2aa90b3f-d184-4390-b241-970a25fa584f"
}
Result
{
"data": {
"package": {
"id": "2aa90b3f-d184-4390-b241-970a25fa584f",
"name": "Meridian Trailer Flat",
"qcStatus": "pending",
"createdAt": "2019-07-18T10:53:24.971Z",
"slug": "meridian-trailer-flat",
"packageTemplateId": null,
"jobId": null,
"job": null,
"type": "classic",
"assetId": "07a7a67f-04be-4f6b-afc7-eca149ee3199",
"asset": {
"id": "07a7a67f-04be-4f6b-afc7-eca149ee3199",
"name": "Meridian Asset 1"
},
"buildStatus": "started",
"basePackage": null,
"buildWorkflow": {
"id": "69e03176-eecf-4e08-b72c-a7144bba28fd",
"status": "started"
}
}
}
}
Creating a Flat Package
To create a flat package without a package template:
Mutation
mutation CreatePackage($input: PackageInput) {
createPackage(input: $input) {
id
}
}
Variables
{
"input": {
"name":"Meridian Master Flat",
"targetDirectoryLocator":{
"type":"S3FileLocator",
"bucket":"connect.ownzones.dev",
"key":"content/packages"
},
"assetId":"a3b1dbd3-181f-4a32-bad9-04bfd6b4306c",
"type":"classic",
"sourceFilesMapping":[
{
"fileId":"3d4676dc-ce31-4528-b862-14fde275e586",
"assignedFileIds":[]
}
],
"elementalProfileId":"",
"hybrikProfileId":""
}
}
Result
{
"data": {
"createPackage": {
"id": "cb74b533-f2c1-4476-ab4e-9004d037ff64",
}
}
}
Creating a Package from a Package Template
To create a package from a package template:
Mutation
mutation CreatePackageFromTemplate($input: PackageFromTemplateInput) {
createPackageFromTemplate(input: $input) {
id
name
}
}
Variables
{
"input": {
"name":"Meridian Trailer Flat",
"packageTemplateId":"9d262bc9-6500-48e3-b3d9-dbbc483a7413",
"assetId":"a3b1dbd3-181f-4a32-bad9-04bfd6b4306c"
}
}
Result
{
"data": {
"createPackageFromTemplate": {
"id": "e0dd35e8-db0f-4f34-bdaa-fc3b367094dc",
"name": "Meridian Trailer Flat"
}
}
}
Creating an IMF Package
To create an IMF package based on a specific CPL:
Mutation
mutation CreatePackage($input: PackageInput) {
createPackage(input: $input) {
id
}
}
Variables
{
"input": {
"name":"Meridian Master IMF",
"targetDirectoryLocator":{
"type":"S3FileLocator",
"bucket":"connect.ownzones.dev",
"key":"content/packages"
},
"assetId":"a3b1dbd3-181f-4a32-bad9-04bfd6b4306c",
"type":"imf",
"sourceFilesMapping":[
{
"fileId":"250f69de-ec82-4626-ba02-5ad98c559ef2",
"assignedFileIds":[]}],
"elementalProfileId":"",
"hybrikProfileId":""
}
}
Result
{
"data": {
"createPackage": {
"id": "15b0d74f-dd4f-4ed3-be19-969701cc9af5"
}
}
}
12. Platforms
Platforms are endpoints which receive content delivered from Connect and Discover. Setting up a platform is a two step process:
- Create an Admin Platform and set up Transcoder Profiles that define how content is transcoded, according to the endpoint's specifications;
- Configure the platform by setting up the delivery method, thus transforming it into an Organization Platform.
Note: Configuring an admin platform requires System Administrator access.
Creating an Admin Platform
To create an admin platform:
Mutation
mutation CreatePlatform($input: PlatformInput) {
createPlatform(input: $input) {
id
}
}
Variables
{
"input": {
"name": "Delivery Platform"
}
}
Result
{
"data": {
"createPlatform": {
"id": "5cb21bd9-ce4c-4a95-abfe-9db193c00300",
}
}
}
Configuring a Platform
To configure a platform (based on its ID) to become an organization platform:
Mutation
mutation CreateOrganizationPlatform($input: OrganizationPlatformInput) {
createOrganizationPlatform(input: $input) {
id
}
}
Variables
{
"input": {
"deliveryProperties":{
"feed":[],
"mediafan":[],
"copy":{
"type":"S3FileLocator",
"bucket":"connect.ownzones.dev",
"key":"delivery",
"accessKeyId":"user1@ownzones.com",
"secretAccessKey":"1js039a0)@nf@a#%magiandl"
}
},
"languages":[],
"organizationId":"35426aee-2bc1-43d7-97fe-e85038075808",
"platformId":"db80d84b-4d7e-4a5f-b0e2-b13b32d3b1c5"
}
}
Result
{
"data": {
"createOrganizationPlatform": {
"id": "d830d1b5-e331-46dd-a6cb-5430e2d5a9d8"
}
}
}
Viewing Admin Platform Details
To view the details of a specific admin platform:
Query
query ReadPlatform($id: ID!) {
platform(id: $id) {
id
name
slug
}
}
Variables
{
"id": "db80d84b-4d7e-4a5f-b0e2-b13b32d3b1c5"
}
Result
{
"data": {
"platform": {
"id": "db80d84b-4d7e-4a5f-b0e2-b13b32d3b1c5",
"name": "Delivery Platform",
"slug": "delivery-platform",
}
}
}
Viewing Organization Platform Details
To view the details of a specific organization platform:
Query
query ReadOrganizationPlatform($id: ID!) {
organizationPlatform(id: $id) {
id
platform {
id
name
}
deliveryProperties {
copy {
type
... on S3FileLocator {
bucket
key
secretAccessKey
accessKeyId
}
... on TransferFileLocator {
protocol
path
username
password
host
port
privateKey
}
}
authentication {
clientId
clientSecretKey
}
feed {
tagId
masterMetadataUrl
}
mediafan {
tagId
feedId
elementalProfile
}
}
emailReceivers {
email
lead
}
languages
}
}
Variables
{
"id": "d07f1034-dc40-46b9-9d42-e68a17a7c3d4"
}
Result
{
"data": {
"organizationPlatform": {
"id": "d07f1034-dc40-46b9-9d42-e68a17a7c3d4",
"platform": {
"id": "509b0c07-aaca-4fe0-9d9b-50df6fae85d7",
"name": "Delivery Platform"
},
"deliveryProperties": {
"copy": {
"type": "S3FileLocator",
"bucket": "connect.ownzones.dev",
"key": "delivery",
"secretAccessKey": null,
"accessKeyId": null
},
"authentication": null,
"feed": [],
"mediafan": []
},
"emailReceivers": null,
"languages": []
}
}
}
13. Transcoding
Transcoding Profiles allow you to transform media according to a list of parameters and reuse the settings for multiple media items, basaed on the configured Transcoder Provider settings (Elemental, Hybrik, Media Convert).
Getting the Transcoder Provider ID
To get the ID of a transcoder provider, based on its name:
Query
query getTranscoderProvider($search:String){
transcoderProviders(search: $search) {
edges {
node {
id
}
}
}
}
Variables
{
"search": "Hybrik"
}
Result
{
"data": {
"transcoderProviders": {
"edges": [
{
"node": {
"id": "8965b240-6cd8-4de3-aebe-29eb22cb36ff"
}
}
]
}
}
}
Viewing Transcoding Profile Details
To get a list of transcoding profiles associated with a specific platform:
Query
query ListTranscoderProfiles($search: String, $filters: TranscoderProfileFilters, $first: Int, $skip: Int) {
transcoderProfiles(search: $search, filters: $filters, first: $first, skip: $skip) {
totalCount
edges {
node {
id
platformId
name
providerType
}
}
}
}
Variables
{
"filters": {
"platformId": {
"eq":"5cb21bd9-ce4c-4a95-abfe-9db193c00300"
}
}
}
Result
{
"data": {
"transcoderProfiles": {
"totalCount": 2,
"edges": [
{
"node": {
"id": "51ab2ea9-b0ae-497c-aafc-b3032136e110",
"platformId": "5cb21bd9-ce4c-4a95-abfe-9db193c00300",
"name": "Hybrik",
"providerType": "Hybrik"
}
},
{
"node": {
"id": "2340acdd-7fbb-4d6e-bfa5-54854aa88bdd",
"platformId": "5cb21bd9-ce4c-4a95-abfe-9db193c00300",
"name": "Hybrik 2",
"providerType": "Hybrik"
}
}
]
}
}
}
Creating a Transcoding Profile
To create a transcoding profile for the specified platform and using the specified transcoding provider:
Mutation
mutation CreateTranscoderProfile($input: TranscoderProfileInput) {
createTranscoderProfile(input: $input) {
id
}
}
Variables
{
"input": {
"name":"tw test 2",
"platformId":"5cb21bd9-ce4c-4a95-abfe-9db193c00300",
"providerType":"Hybrik",
"providerId":"6db639bd-f6fd-4106-b499-4546a53a0415",
"outputSuffix":"_new",
"outputExtension":".mov",
"containerHybrik":{
"kind":"MOV"
}
}
}
Result
{
"data": {
"createTranscoderProfile": {
"id": "2340acdd-7fbb-4d6e-bfa5-54854aa88bdd"
}
}
}
Transcoding an IMF Media Item
To start an IMF-to-flat package conversion:
Mutation
mutation ConvertPackageToFlat($options: TranscodePackageOptionsInput!) {
transcodePackage(options: $options) {
id
}
}
Variables
{
"options": {
"packageId":"435c4922-0adb-4403-bec3-061cc46ddd18",
"packageName":"Meridian IMF to Flat",
"targetDirectoryLocator":{
"type":"S3FileLocator",
"bucket":"connect.ownzones.dev",
"key":"content/packages"
},
"transcoderProfileId":"771cf64f-68a3-401a-b98e-51027657c329"
}
}
Result
{
"data": {
"transcodePackage": {
"id": "a4e8b9fa-da59-454c-be3b-af8711e24536"
}
}
}
14. Clips
Clips represent sections of video files and are used in IMF workflows to quickly swap resources or view different versions of the same content.
Viewing a List of CPL Clips
To retrieve a list of clips associated with a specific CPL:
Query
query ListCplClips($filters: ClipFilters!, $search: String, $orderBy: [ClipOrderBy], $first: Int, $skip: Int) {
clips(filters: $filters, search: $search, orderBy: $orderBy, first: $first, skip: $skip) {
edges {
node {
id
fileId
name
description
entryPoint
duration
status
clips {
id
file {
id
locatorUrl
downloadUrl
fileLocator { url }
generatorWorkflow {
id
}
}
}
}
}
totalCount
}
}
Variables
{
"filters": {
"fileId": {
"eq":"9bf5a30e-4dfa-4261-97fb-c209a2a931c2"
},
"parentId": {
"isNull":true
}
},
"first": 3,
"skip": 0
}
Result
{
"data": {
"clips": {
"edges": [
{
"node": {
"id": "9c3dbc22-15a1-480c-b502-0e91c3c843e3",
"fileId": "9bf5a30e-4dfa-4261-97fb-c209a2a931c2",
"name": "clip3",
"description": "Clip 3",
"entryPoint": 20,
"duration": 20,
"status": "created",
"clips": []
}
},
{
"node": {
"id": "7b0b6081-dc6f-4db7-9f5c-3377644aa471",
"fileId": "9bf5a30e-4dfa-4261-97fb-c209a2a931c2",
"name": "BlackboardText",
"description": "Text on the blackboard",
"entryPoint": 21,
"duration": 109,
"status": "created",
"clips": []
}
},
{
"node": {
"id": "64863472-187a-47e7-84b3-5f0c5275fb83",
"fileId": "9bf5a30e-4dfa-4261-97fb-c209a2a931c2",
"name": "clip4",
"description": "Clip 4",
"entryPoint": 20,
"duration": 10,
"status": "extracted",
"clips": [
{
"id": "9a08aef4-a0bf-40f2-b636-aa624082c749",
"file": {
"id": "bc09fec9-36b8-42b8-a2f9-8ea8acb79e34",
"locatorUrl": "s3://ownzones-dev/content/clips/20_clip4_clip_f4715ae4-c0f2-4621-be7d-2980d76d9fb4.mxf",
"downloadUrl": "https://ownzones-dev.s3.amazonaws.com/content/clips/20_clip4_clip_f4715ae4-c0f2-4621-be7d-2980d76d9fb4.mxf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAWIUNFUKQ3TM4BTU6%2F20190917%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190917T094924Z&X-Amz-Expires=21600&X-Amz-Security-Token=AgoJb3JpZ2luX2VjEKb%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FwEaCXVzLWVhc3QtMSJIMEYCIQCRUIvNtamEgZZfPjbBzs0rtHtuOqkyphp8zM73FDin1wIhAO7DyPec0qUg3bWghdJfQ0Rg4LZDhUKJGMsi7PX9acynKtoDCG8QARoMNDMwODY2NTM5MTY5IgwGeEPkg7KPWqaOUvYqtwNj3gTTxH5cvcz%2BvCvmD70KaNDLl3nxN1L2PJ4nuDncKfU4LuaYYmEZBJTjvqwFF0cgkPpz4pl3woBxJx56M%2BsLS8uTDmWzF3yRMSKloyG4ukp%2Fl4%2FK4Q5H6bi64dDnKvIs8dgG6lYbQk2EpF8W3aubvsGArs7pKvpJ0%2FtmAhvn1xUp9n%2BNTWH5fZglEAEegoQAu32aPR%2BTfvyiKKks9%2BEFEv1Hg6t3sLwk%2FjGLHOSUEqz7wgeZZkT1J1BQ9oq8GXrPRqKz67GcDEv1cCpiOsDr7pja03drN%2F8AvkEqSfKFAlxKOOJPiYQBucPktOMoELwxTizWAT%2BjIgrJmERPlAMVO38M7PvA0goL%2B7WjUfv7VTSv8HHTcCrtwxqop%2Bd0Ag7QRYZ6OmI5%2FuJfjZYvo0h7OwSvdIM%2FSDD1d%2FOI7m8kGOCZ8dRtKgNE4oy5gZ281fESFRnsbe1eD8G6%2F9lVc3Vw%2Fe2yPVT2KE%2FACqHzmQ2JUNJec7TTshOX5TicWNcPK%2FvDny%2FIM58QmK7tvtWkyc1NJ7pd4gDugUuyL2urp%2Bv9qe5XxZ%2BkdYMR2dcvWlncvmvzXb3kVbDMMInigewFOrMBDZKGlVBQe9MQYzr6F5WBXQT5CAbUeWfdHWO3qKQii41LVmc6amrcugtwTrHx3gUN0brTT2noQd6HnqNr9yCNaGQMWghvyBjkC3FSEb3xNql0lkFdf7E7Mq0BBVMXYmYs00GWTNdlS7LoK2dlnD1s1o%2BCAF5p42ln7yQ4wmpeLfzbNI8ZGhDPsnm2YUmnejlOktBqbcz0S7yrdXZIAFS0H5hjUjXoJs9i%2Fzquj6gWMSIsYFs%3D&X-Amz-Signature=a9e464d044d573adff318ddff9399b3380c370198c26f5f696ed7130cb63487b&X-Amz-SignedHeaders=host&response-content-disposition=attachment",
"fileLocator": {
"url": "s3://ownzones-dev/content/clips/20_clip4_clip_f4715ae4-c0f2-4621-be7d-2980d76d9fb4.mxf"
},
"generatorWorkflow": {
"id": "1408fd93-878c-41ec-a5b8-c8366dec7d84"
}
}
}
]
}
},
{
"node": {
"id": "2f715ed9-143e-4917-a1c7-b2d2b2358c58",
"fileId": "9bf5a30e-4dfa-4261-97fb-c209a2a931c2",
"name": "clip2",
"description": "Clip 2",
"entryPoint": 10,
"duration": 10,
"status": "created",
"clips": []
}
},
{
"node": {
"id": "5fe872e7-a3ff-483f-b7e0-97511a04b1ed",
"fileId": "9bf5a30e-4dfa-4261-97fb-c209a2a931c2",
"name": "clip1",
"description": "Clip 1",
"entryPoint": 0,
"duration": 10,
"status": "created",
"clips": []
}
}
],
"totalCount": 5
}
}
}
Creating Clips
To create a clip for a specific file:
Mutation
mutation CreateCplClip($input: ClipInput) {
createClip(input: $input) {
id
}
}
Variables
{
"input": {
"name":"BlackboardText",
"description":"Text on the blackboard",
"entryPoint":21,
"duration":109,
"fileId":"9bf5a30e-4dfa-4261-97fb-c209a2a931c2"
}
}
Result
{
"data": {
"createClip": {
"id": "7b0b6081-dc6f-4db7-9f5c-3377644aa471"
}
}
}
Extracting Clips
To extract a specific clip:
Mutation
mutation ExtractCplClip($id: ID!) {
extractClip(id: $id) {
id
}
}
Variables
{
"id": "64863472-187a-47e7-84b3-5f0c5275fb83"
}
Result
{
"data": {
"extractClip": {
"id": "1408fd93-878c-41ec-a5b8-c8366dec7d84"
}
}
}
Replacing Clips
To replace a clip with another media item (from the same parent asset):
Mutation
mutation CreateClipVersion($clipId: ID!, $fileId: ID!, $preserveUploadClipMetadata: Boolean) {
createClipVersion(clipId: $clipId, fileId: $fileId, preserveUploadClipMetadata: $preserveUploadClipMetadata) {
id
}
}
Variables
{
"clipId": "c1be7715-19c5-4050-afe6-4b460aa0d2cc",
"fileId": "bb35f063-a670-4efe-987f-cfac5e8878fc",
"preserveUploadClipMetadata": false
}
Result
{
"data": {
"createClipVersion": {
"id": "d8bd8595-486c-4247-bb9e-2de0d229be8d"
}
}
}
Note: Keep in mind that the
createClipVersion
mutation only adds the media item into the list of items that can be used to replace a clip. When processing CPL outputs, you must make sure that the correct clip is used from the list.