laravel-ffmpeg
laravel-ffmpeg copied to clipboard
Question: Progress no longer working
Hello, I am using this package to convert some video files (which are stored on S3) and it worked wonders until recently.
It looks like the progress listener is now only triggering when the percentage reaches 100.
Did something change in the package, or the parent package?
In case this helps, here is a snippet of my code:
$format = (new X264())
->setAudioCodec(config('medialibrary.audio_codec', 'aac'))
->setKiloBitrate(1000)
->setAudioChannels(2)
->setAudioKiloBitrate(256);
FFMpeg::fromDisk(config('filesystems.default'))
->open($oldFileRelativePath)
->export()
->onProgress(function ($percentage) {
if (!($percentage % 10) && $percentage < 100) {
$this->media->setCustomProperty('conversion_progress', $percentage);
$this->media->save();
}
})
->toDisk(config('filesystems.default'))
->inFormat($format)
->save($newFileRelativePath)
->cleanupTemporaryFiles();