Getting Started with the APIs

Getting Started with Media Encoding Cluster APIs

The Media Encoding Cluster is designed for many purposes.
Below is the general, recommended workflow for getting started with the APIs and determining your needs.

In this Guide we want to build the simple Flow described in the Image below.
this is a graphical representation of flow

some flows could be really complex without loosing there clearness.

all the following actions will be performed with "curl", please make sure it is available on your System.

Create a Profile that targets your Format

- create a File "example.profile" with the following content.(File could also be downloaded from here)
{
    "name": "Apple Ipad x264(640x480) aac(160kb 48kHz stereo)",
    "description": "here comes a detailed description of the profile",
    "format": {
        "id": "ipod",
        "ext": "m4v"
    },
    "video": {
        "id": "libx264",
        "b": "2400",
        "maxrate": "10000",
        "bufsize": "10000",
        "g": "66",
        "loop": "1",
        "qmin": "10",
        "qmax": "51",
        "qdiff": "4",
        "coder": "0",
        "bf": "2",
        "refs": "2",
        "wpred": "0",
        "dct8x8": "0",
        "wpredp": "0",
        "me_range": "16",
        "time_base": "1/25",
        "aspect": "64/45",
        "width": "640",
        "height": "480",
        "global_header": "1"
    },
    "audio": {
        "id": "aac",
        "ab": "160000",
        "ac": "2",
        "ar": "48000",
        "global_header": "1"
    }
}

- POST the File "example.profile" with CURL to the Media Encoding Cluster
curl -d @Downloads/example.profile http://localhost:4000/api/v1/profile

- this is the Response of the previous executed comand on creating a profile.
{
        "response" : {
                "status" : "ok",
                "message" : "Profile successful created",
                "requestID" : "fda3a754-4cc9-11e1-8b6e-0023ae8ddf40"
        },
        "uuid" : "fda69d7e-4cc9-11e1-a9a6-0023ae8ddf40"
}

Create a Flow that uses your Profile

- create a file "example.flow" with the following content.(File could also be downloaded from here)
{
    "tasks": [
        {
            "name": "InputTask",
            "uid": 1,
            "data": {
                "infile": ""
            }
        },
        {
            "name": "EncodingTask",
            "uid": 2,
            "data": {
                "profile-uuid": "fda69d7e-4cc9-11e1-a9a6-0023ae8ddf40"
            }
        },
        {
            "name": "UploadTask",
            "uid": 3,
            "data": {
                "outfile": "/tmp/test"
            }
        }
    ],
    "links": [
        {
            "uid": 1,
            "linksTo": 2
        },
        {
            "uid": 2,
            "linksTo": 3
        }
    ],
    "name": "new shiny encoding flow"
}






- POST the File "example.flow" with CURL to the Media Encoding Cluster
curl -d @Downloads/example.flow http://localhost:4000/api/v1/flow

- this is the Response of the previous executed comand on creating a flow.
{
    "response": {
        "status": "ok",
        "message": "Flow Successful created.",
        "requestID": "5d8405d4-4cce-11e1-b743-0023ae8ddf40"
    },
    "uuid": "5d8408b8-4cce-11e1-b69a-0023ae8ddf40"
}

Submit the Flow to do the Job

to submit a Flow to the Job Queue, you can issue the following command to submit a Flow with an Inputfile Path

curl -X POST http://localhost:4000/api/v1/flow/5d8408b8-4cce-11e1-b69a-0023ae8ddf40//media/video/test.mp4


- this is the Response of the previous executed comand on creating a flow.
{
    "response": {
        "status": "ok",
        "message": "flow successful submitted",
        "requestID": "7a3846e8-4bdb-11e1-a99b-0023ae8ddf40"
    }
    "uuid":"d769a001-d57f-4898-86c8-100cffe768b3"
}

ą
Jan Hölscher,
2 Feb 2012, 04:08
ċ
example.flow
(1k)
Jan Hölscher,
1 Feb 2012, 03:50
ċ
example.profile
(1k)
Jan Hölscher,
1 Feb 2012, 03:43
Comments