classes/Video.php
public function getM3uStream()
    {
        if (!$this->checkCommand([$this->config->avconv, '-version'])) {
            throw new Exception(_('Can\'t find avconv or ffmpeg at ').$this->config->avconv.'.');
        }

        $urls = $this->getUrl();

        $process = new Process(
            [
                $this->config->avconv,
                '-v', $this->config->avconvVerbosity,
                '-i', $urls[0],
                '-f', $this->ext,
                '-c', 'copy',
                '-bsf:a', 'aac_adtstoasc',
                '-movflags', 'frag_keyframe+empty_moov',
                'pipe:1',
            ]
        );

        $stream = popen($process->getCommandLine(), 'r');
        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getM3uStream()
    {
        if (!$this->checkCommand([$this->config->avconv, '-version'])) {
            throw new Exception(_('Can\'t find avconv or ffmpeg at ').$this->config->avconv.'.');
        }

        $urls = $this->getUrl();

        $process = new Process(
            [
                $this->config->avconv,
                '-v', $this->config->avconvVerbosity,
                '-i', $urls[0],
                '-f', $this->ext,
                '-c', 'copy',
                '-bsf:a', 'aac_adtstoasc',
                '-movflags', 'frag_keyframe+empty_moov',
                'pipe:1',
            ]
        );

        $stream = popen($process->getCommandLine(), 'r');
        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getM3uStream ( ) { if ( ! $ this -> checkCommand ( [ $ this -> config -> avconv , '-version' ] ) ) { throw new Exception ( _ ( 'Can\'t find avconv or ffmpeg at ' ) . $ this -> config -> avconv . '.' ) ; } $ urls = $ this -> getUrl ( ) ; $ process = new Process ( [ $ this -> config -> avconv , '-v' , $ this -> config -> avconvVerbosity , '-i' , $ urls [ 0 ] , '-f' , $ this -> ext , '-c' , 'copy' , '-bsf:a' , 'aac_adtstoasc' , '-movflags' , 'frag_keyframe+empty_moov' , 'pipe:1' , ] ) ; $ stream = popen ( $ process -> getCommandLine ( ) , 'r' ) ; if ( ! is_resource ( $ stream ) ) { throw new Exception ( _ ( 'Could not open popen stream.' ) ) ; } return $ stream ; }
Get video stream from an M3U playlist.

@throws Exception If avconv/ffmpeg is missing
@throws Exception If the popen stream was not created correctly

@return resource popen stream
Get video stream from an M3U playlist .