/** * * @param TaskModel $task * @return string */ private function resolveResolution(TaskModel $task) { //se non settata eredita quella del sorgente del job $resolution = $task->resolution; if (empty($resolution)) { $sourceFile = $task->job()->first()->files()->firstOrFail(); $ffprobe = $sourceFile->getMeta(FileModel::META_FFPROBE_KEY); $width = $ffprobe['streams'][0]['width']; $height = $ffprobe['streams'][0]['height']; $resolution = "{$width}x{$height}"; } return $resolution; }
/** * Esegue i Task del Job * * @param bool $queued (default true) * @return bool */ public function executeTasks($queued = true) { $job = $this->getDao(); $tasks = TaskModel::where('job_id', '=', $job->id)->get(); foreach ($tasks as $task) { $this->pushInQueue('TranscodeJob', ['jobId' => $job->id, 'taskId' => $task->id], TUBE_TRANSCODER); } return true; }