Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ffmpeg = FFMpegFFMpeg::create(array(
- 'ffmpeg.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffmpeg',
- 'ffprobe.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/bin/ffprobe',
- 'timeout' => 3600, // The timeout for the underlying process
- 'ffmpeg.threads' => 12, // The number of threads that FFMpeg should use
- ));
- // set the path of the video file, which you might consider to get the input from the user
- $video = $ffmpeg->open('video.mpg');
- // apply filters to resize the clip
- $video
- ->filters()
- ->resize(new FFMpegCoordinateDimension(320, 240))
- ->synchronize();
- // crop a frame from a particular timecode
- $video
- ->frame(FFMpegCoordinateTimeCode::fromSeconds(10))
- ->save('frame.jpg');
- //transcode clip
- $video
- ->save(new FFMpegFormatVideoX264(), 'export-x264.mp4');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement