Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Set our source file
- $srcFile = $uploadFilm.".".$film_type;
- $destFile = $uploadFilm;
- $ffmpegPath = "ffmpeg";
- // Create our FFMPEG-PHP class
- $ffmpegObj = new ffmpeg_movie($srcFile);
- // Save our needed variables
- $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
- $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
- $srcFPS = $ffmpegObj->getFrameRate();
- if($ffmpegObj->hasAudio()){
- $srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
- $srcAR = $ffmpegObj->getAudioSampleRate();
- }else{
- $srcAB = 0;
- $srcAR = 0;
- }
- // Call our convert using exec()
- //$command = $ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . "k -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile;
- //$command = "whoami";
- $command = $ffmpegPath . ' -i ' .'"'. $srcFile . '" -ar ' . $srcAR . ' -ab ' . $srcAB . 'k -f flv -s ' . $srcWidth . 'x' . $srcHeight . ' "' . $destFile . '" 2>&1';
- $outputCommand = array();
- $status = 1;
- exec($command, $outputCommand, $status);
- Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
- ffmpeg -i source -ar 48000 -ab 160k -f flv -s 1920x1080 destination
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement