Basics
We’re going to get started with a simple video transcoding workflow: one video input and one output.
Requirements
Before anything, you need to have the CPE stack installed and configured properly to load the Cloud Transcoding activities.
So head to the CPE documentation page and follow the “GET STARTED” section to have a running stack: http://sportarchive.github.io/CloudProcessingEngine/start/introduction.html
Only once you have setup CPE and understand how it works you should go further in this documentation
Plan
The CPE decider loads a Plan.yml that you need to write. If you followed the CPE “GET STARTED” documentation your decider should be running the CT example plan (ct_plan_simple.yml) that we will use for this example. You should have edited it to reference your own Video files in AWS S3.
See this plan here: http://sportarchive.github.io/CloudProcessingEngine/comp/decider.html#decider-plan
This plan contains couple steps:
- ValidateAssetStep: Processed by activity
ValidateAsset
versionv2
- TranscodeAssetStep: Processed by activity
TranscodeAsset
versionv2
As input for the first step, we use the worflow input data. {{__input__}}
is a keyword that references the Workflow input payload your client app sent when starting the job.
For the second step, we craft a specific input to match the TranscodeAsset
activity requirements. We include data from the workflow payload and also the output of ValidateAssetStep
.
Each activities expect and accept a certain JSON format. We detail their requirements later in this documentation.
Checklist
At this point you should have running:
- Decider: Using a custom plan or the ct_plan_simple.yml example we provided
- InputPoller: Listening to your SQS input queue
- ActivityPoller (ValidateAsset): One worker for probing assets and listening to the proper Activity TaskList (by default the Activity TaskList is set by the Decider at:
activity_name
-activity_version
). - ActivityPoller (TranscodeAsset): One worker for transcoding assets and listening to the proper Activity TaskList (by default the Activity TaskList is set by the Decider at:
activity_name
-activity_version
).
For testing your setup, you should have the two client_example scripts started as well. See: http://sportarchive.github.io/CloudProcessingEngine/start/use-the-stack.html
Now you can transcode things. If you followed the CPE Getting Started it should work.
Start a job
Using the ClientCommander.php located in the CPE project, start the following:
php ClientCommander.php -c clientConfig.json
Command [enter]: start_job input_samples/input_video.json
It will send an SQS message to the InputPoller that will start a new workflow for you. You should see your ValidateAsset ActivityPoller do some work. Look at the log file by default located in /var/tmp/logs/cpe/
. Then the TranscodeAsset ActivityPoller will start once the first task is over.