classes/Video.php
public function getConvertedStream($audioBitrate, $filetype)
    {
        if (in_array($this->protocol, ['m3u8', 'm3u8_native'])) {
            throw new Exception(_('Conversion of M3U8 files is not supported.'));
        }

        $avconvProc = $this->getAvconvProcess($audioBitrate, $filetype, false);

        $stream = popen($avconvProc->getCommandLine(), 'r');

        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getConvertedStream($audioBitrate, $filetype)
    {
        if (in_array($this->protocol, ['m3u8', 'm3u8_native'])) {
            throw new Exception(_('Conversion of M3U8 files is not supported.'));
        }

        $avconvProc = $this->getAvconvProcess($audioBitrate, $filetype, false);

        $stream = popen($avconvProc->getCommandLine(), 'r');

        if (!is_resource($stream)) {
            throw new Exception(_('Could not open popen stream.'));
        }

        return $stream;
    }
public function getConvertedStream ( $ audioBitrate , $ filetype ) { if ( in_array ( $ this -> protocol , [ 'm3u8' , 'm3u8_native' ] ) ) { throw new Exception ( _ ( 'Conversion of M3U8 files is not supported.' ) ) ; } $ avconvProc = $ this -> getAvconvProcess ( $ audioBitrate , $ filetype , false ) ; $ stream = popen ( $ avconvProc -> getCommandLine ( ) , 'r' ) ; if ( ! is_resource ( $ stream ) ) { throw new Exception ( _ ( 'Could not open popen stream.' ) ) ; } return $ stream ; }
Get the stream of a converted video.

@param int    $audioBitrate Audio bitrate of the converted file
@param string $filetype     Filetype of the converted file

@throws Exception If your try to convert and M3U8 video
@throws Exception If the popen stream was not created correctly

@return resource popen stream
Get the stream of a converted video .