private function getRtmpProcess($video)
{
if (!shell_exec('which ' . $this->config->rtmpdump)) {
throw new \Exception('Can\'t find rtmpdump');
}
$builder = new ProcessBuilder([$this->config->rtmpdump, '-q']);
$builder = $this->addOptionsToRtmpProcess($builder, $video);
if (isset($video->rtmp_conn)) {
foreach ($video->rtmp_conn as $conn) {
$builder->add('--conn');
$builder->add($conn);
}
}
return $builder->getProcess();
}