laravel-ffmpeg icon indicating copy to clipboard operation
laravel-ffmpeg copied to clipboard

Is there a way to FFprobe::fromDisk('s3')

Open selajdinbilali opened this issue 1 year ago • 0 comments

I need to get meta data from a file in S3.

Is there an easy way like FFprobe::fromDisk('s3') ?

I tried :

  • to open the file with ffmpeg but streams() accepts only string.
  • to create a temporaryUrl of Storage facade, but it's still unable to probe.

Thanks in advance for your help.

Previously it was easy because the file was in my filesystem :

        $ffprobe = FFProbe::create();
        $media_file = $ffprobe->streams($fullFilePath);
        $codec_type = $media_file->first()->get('codec_type');

        if ($codec_type === 'audio') {
            $codec_name = $media_file->audios()->first()->get('codec_name');
            if ($codec_name !== 'aac') {
                return 'Non valid audio codec, we only accept aac';
            }
        } else {
            $codec_name = $media_file->videos()->first()->get('codec_name');
            if ($codec_name !== 'h264') {
                return 'Non valid video codec, we only accept h264';
            }
        }

selajdinbilali avatar Jun 21 '24 13:06 selajdinbilali