Experimental support for M3U streams
This commit is contained in:
parent
1a6e995262
commit
28a8addbf1
5 changed files with 56 additions and 14 deletions
|
@ -38,7 +38,12 @@ class Config
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
public $params = ['--no-playlist', '--no-warnings', '-f best[protocol^=http]', '--playlist-end', 1];
|
||||
public $params = [
|
||||
'--no-playlist', '--no-warnings',
|
||||
//We can allow non-HTTP URLs on the feature/stream branch
|
||||
'-f best',
|
||||
'--playlist-end', 1
|
||||
];
|
||||
|
||||
/**
|
||||
* Enable audio conversion.
|
||||
|
|
|
@ -292,4 +292,28 @@ class VideoDownload
|
|||
|
||||
return popen($chain->getProcess()->getCommandLine(), 'r');
|
||||
}
|
||||
|
||||
public function getM3uStream(\stdClass $video)
|
||||
{
|
||||
if (!shell_exec('which '.$this->config->avconv)) {
|
||||
throw(new \Exception('Can\'t find avconv or ffmpeg'));
|
||||
}
|
||||
|
||||
$procBuilder = ProcessBuilder::create(
|
||||
[
|
||||
$this->config->avconv,
|
||||
'-v', 'quiet',
|
||||
'-i', $video->url,
|
||||
'-f', $video->ext,
|
||||
'-c', 'copy',
|
||||
'-bsf:a', 'aac_adtstoasc',
|
||||
'-movflags', 'frag_keyframe+empty_moov',
|
||||
'pipe:1',
|
||||
]
|
||||
);
|
||||
|
||||
//dump($procBuilder->getProcess()->getCommandLine()); die;
|
||||
|
||||
return popen($procBuilder->getProcess()->getCommandLine(), 'r');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue