Created
October 31, 2022 07:09
-
-
Save rmcdaniel/f1a9900f7493326571a37b897b35393e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Workflows\ConvertVideo; | |
use FFMpeg\FFMpeg; | |
use FFMpeg\Format\Video\WebM; | |
use Workflow\Activity; | |
class ConvertVideoWebmActivity extends Activity | |
{ | |
public $timeout = 5; | |
public function execute($input, $output) | |
{ | |
$ffmpeg = FFMpeg::create(); | |
$video = $ffmpeg->open($input); | |
$format = new WebM(); | |
$format->on('progress', fn () => $this->heartbeat()); | |
$video->save($format, $output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment