Add rtmp tests

This commit is contained in:
Pierre Rudloff 2016-07-30 14:01:00 +02:00
parent ef65cb502b
commit 37c223638d
4 changed files with 53 additions and 8 deletions

View file

@ -35,6 +35,7 @@ class Config
public $convert = false;
public $avconv = 'vendor/bin/ffmpeg';
public $rtmpdump = 'vendor/bin/rtmpdump';
public $curl = '/usr/bin/curl';
public $curl_params = array();
/**

View file

@ -196,21 +196,27 @@ class VideoDownload
$builder->add('--playpath');
$builder->add($video->play_path);
}
foreach ($video->rtmp_conn as $conn) {
$builder->add('--conn');
$builder->add($conn);
if (isset($video->rtmp_conn)) {
foreach ($video->rtmp_conn as $conn) {
$builder->add('--conn');
$builder->add($conn);
}
}
if (isset($video->app)) {
$builder->add('--app');
$builder->add($video->app);
}
$chain = new Chain($builder->getProcess());
$chain->add('|', $avconvProc);
} else {
if (!shell_exec('which curl')) {
if (!shell_exec('which '.$this->config->curl)) {
throw(new \Exception('Can\'t find curl'));
}
$chain = new Chain(
ProcessBuilder::create(
array_merge(
array(
'curl',
$this->config->curl,
'--silent',
'--location',
'--user-agent', $video->http_headers->{'User-Agent'},