public function create($filePath, $settings)
{
$this->assertValidSettings($settings);
$data = ['input' => $filePath, 'outputs' => $this->buildOutputSettings($filePath, $settings)];
try {
$job = $this->Zencoder->jobs->create($data);
} catch (\Services_Zencoder_Exception $e) {
// we want a better error message for our exception
// so that's what we are doing here
throw new InvalidEncodingSettingsException($e->getErrors()->{'0'});
}
$this->Event->fire('devise.encoding.zencoder.started', [$job]);
return $job;
}