0

I want to create a web that can cut video now. If possible, try to use ffmpeg. However, FFMpeg has been successfully used as a module, but FFMpeg :: create has not been used. How do I use FFMpeg :: create?

enter image description here

<?php
require 'vendor/autoload.php';
$ffmpeg = FFMpeg\FFMpeg::create();
$video  = $ffmpeg->open('video.mpg');
$video->filters()->resize(new FFMpeg\Coordinate\Dimension(320, 240))->synchronize();
$video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10))->save('frame.jpg');
$video->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4')->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv')->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm');
Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
  • What do you mean, by "has not been used"? – Nico Haase Dec 29 '17 at 12:34
  • It means i installed ffmpeg and ffmpeg-php successfull , but ffmpeg-php object is not active – 피닉스안 Dec 30 '17 at 07:09
  • How do you see that an object is not active? Can you share the code you used so far? – Nico Haase Dec 30 '17 at 07:25
  • require 'vendor/autoload.php'; $ffmpeg = FFMpeg\FFMpeg::create(); $video = $ffmpeg->open('video.mpg'); $video ->filters() ->resize(new FFMpeg\Coordinate\Dimension(320, 240)) ->synchronize(); $video ->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10)) ->save('frame.jpg'); $video ->save(new FFMpeg\Format\Video\X264(), 'export-x264.mp4') ->save(new FFMpeg\Format\Video\WMV(), 'export-wmv.wmv') ->save(new FFMpeg\Format\Video\WebM(), 'export-webm.webm'); – 피닉스안 Dec 30 '17 at 08:20
  • And how do you see that something is not active? Does this code throw an exception? – Nico Haase Dec 30 '17 at 08:38
  • FFMpeg::create() is not adapt. The page that generated this object did not work properly. – 피닉스안 Dec 30 '17 at 10:53

0 Answers0