JSON PHP - Simple Example PHP - Presets
{
"file": "http://mydomain.com/media/my-source.flv",
"outputs": [{
"type": "video",
"filename": "output-high.mp4",
"format": "mp4",
"video_codec": "h264",
"hint": true
}],
"passback_url": "http://yourdomain.com/passback/script.php",
"passback": {
"my-var": 123456
},
"passback_headers": {
"Header-Token": 123456789
},
"delivery": ['S3'],
"delivery_zip_filename": "output-files.zip"
}
require './lib/SkyEncoder.php';
$sky = new SkyEncoder('your-secret-key', 'your-api-token');
$resp = $sky->createJob(array(
'file' => 'http://mydomain.com/media/my-source.flv'
'outputs' => array(
'type' => 'video',
'filename' => 'output-high.mp4',
'format' => 'mp4',
'video_codec' => 'h264',
'hint' => true
),
));
require './lib/SkyEncoder.php';
$sky = new SkyEncoder('your-secret-key', 'your-api-token');
$resp = $sky->createJob(array(
'file' => 'http://mydomain.com/media/my-source.flv'
'outputs' => array(
'type' => 'video',
'filename' => 'output-high.mp4',
'preset' => 'mp4_medium'
),
));
🚧 Make sure that you provide a publicly accessible URL for your source/input file.
Parameter Default Description type (required) video Options: video, audio, image filename (source video name) The output video filename (include extension) . preset Use the name of a pre-defined output task preset from our formats.json file. passback Output-specific passback parameters that will be included with the task details. priority 0 Output-specific priority order for dedicated resources. Output tasks are sorted in DESCENDING and queue date by the worker services.
Parameter Default Description format mp4 The output video container to use video_codec h264 The output video codec to use video_codec_profile main H264 Codec Only; Options: main, baseline, high hint true H264 Codec Only; add moov atom deinterlace false Deinterlace the output video audio_codec aac The audio codec for the output video audio_channels (auto detect) Select the number of audio channels; options: 1 (mono), 0 (other/auto detect) audio_sample_rate 22050 The audio sample rate for the output height (source height) Height in pixels width (aspect ratio of height) Width in pixels
Parameter Default Description format aac The output audio codec to use audio_bitrate 128 The audio bitrate audio_channels (auto detect) Select the number of audio channels; options: 1 (mono), 0 (other/auto detect) sample_rate (auto detect) The audio sample rate for the output max_sample_rate The max audio sample rate for the output
Parameter Default Description format jpg Image format; Options: jpg, png, gif seconds 0 The number of seconds into the video to take the screenshot. height (source height) Height in pixels width (aspect ratio of height) Width in pixels