Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. $ffmpeg = FFMpegFFMpeg::create(array(
  2. 'ffmpeg.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffmpeg',
  3. 'ffprobe.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffprobe',
  4. 'timeout' => 3600, // The timeout for the underlying process
  5. 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
  6. ));
  7.  
  8. // set the path of the video file, which you might consider to get the input from the user
  9. $video = $ffmpeg->open('video.mpg');
  10.  
  11. // apply filters to resize the clip
  12. $video
  13. ->filters()
  14. ->resize(new FFMpegCoordinateDimension(320, 240))
  15. ->synchronize();
  16.  
  17. // crop a frame from a particular timecode
  18. $video
  19. ->frame(FFMpegCoordinateTimeCode::fromSeconds(10))
  20. ->save('frame.jpg');
  21.  
  22. //transcode clip
  23. $video
  24. ->save(new FFMpegFormatVideoX264(), 'export-x264.mp4');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement