Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在laravel 4中使用php FFMpeg?_Php_Laravel 4_Ffmpeg_Ffmpeg Php - Fatal编程技术网

如何在laravel 4中使用php FFMpeg?

如何在laravel 4中使用php FFMpeg?,php,laravel-4,ffmpeg,ffmpeg-php,Php,Laravel 4,Ffmpeg,Ffmpeg Php,我是新来的拉威尔4。我已经在本地Laravel设置中安装了php-ffmpeg,但是我需要关于如何将此ffmpeg与Laravel 4一起使用的帮助?假设您的本地主机服务器上已经安装了ffmpeg,那么在Laravel中,您需要设置ffmpeg和ffprobe二进制文件的路径,如下所示: $ffmpeg = FFMpeg\FFMpeg::create(array( 'ffmpeg.binaries' => '/usr/local/Cellar/ffmpeg/2.1.3/

我是新来的拉威尔4。我已经在本地Laravel设置中安装了
php-ffmpeg
,但是我需要关于如何将此ffmpeg与Laravel 4一起使用的帮助?

假设您的本地主机服务器上已经安装了
ffmpeg
,那么在Laravel中,您需要设置ffmpegffprobe二进制文件的路径,如下所示:

$ffmpeg = FFMpeg\FFMpeg::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 FFMpeg\Coordinate\Dimension(320, 240))
  ->synchronize();

// crop a frame from a particular timecode
$video
  ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))
  ->save('frame.jpg');

// transcode clip
$video
  ->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4');

关于

的PHP FFMpeg文档中提供了更多示例,感谢您的回复。请告诉我,如果你知道的话,我该怎么用。现在我自己解决了这个问题。我找到了这个命令,并用命令给出了路径。谢谢,如果您添加解决方案作为答案并接受它会很好