Advertisement
Guest User

Untitled

a guest
Jul 30th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. // Set our source file
  2. $srcFile = $uploadFilm.".".$film_type;
  3. $destFile = $uploadFilm;
  4. $ffmpegPath = "ffmpeg";
  5.  
  6. // Create our FFMPEG-PHP class
  7. $ffmpegObj = new ffmpeg_movie($srcFile);
  8.  
  9. // Save our needed variables
  10. $srcWidth = makeMultipleTwo($ffmpegObj->getFrameWidth());
  11. $srcHeight = makeMultipleTwo($ffmpegObj->getFrameHeight());
  12. $srcFPS = $ffmpegObj->getFrameRate();
  13. if($ffmpegObj->hasAudio()){
  14. $srcAB = intval($ffmpegObj->getAudioBitRate()/1000);
  15. $srcAR = $ffmpegObj->getAudioSampleRate();
  16. }else{
  17. $srcAB = 0;
  18. $srcAR = 0;
  19. }
  20.  
  21. // Call our convert using exec()
  22. //$command = $ffmpegPath . " -i " . $srcFile . " -ar " . $srcAR . " -ab " . $srcAB . "k -f flv -s " . $srcWidth . "x" . $srcHeight . " " . $destFile;
  23. //$command = "whoami";
  24. $command = $ffmpegPath . ' -i ' .'"'. $srcFile . '" -ar ' . $srcAR . ' -ab ' . $srcAB . 'k -f flv -s ' . $srcWidth . 'x' . $srcHeight . ' "' . $destFile . '" 2>&1';
  25. $outputCommand = array();
  26. $status = 1;
  27. exec($command, $outputCommand, $status);
  28.  
  29. Error while opening encoder for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
  30.  
  31. ffmpeg -i source -ar 48000 -ab 160k -f flv -s 1920x1080 destination
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement