<?php $error = ''; $duration = 0; try { $ffmpeg = FFMpeg\FFMpeg::create(); } catch ( Exception $ffmpeg ) { $error = $ffmpeg->getMessage(); } if ( empty( trim( $error ) ) ) { $ff_probe = FFMpeg\FFProbe::create(); $duration = $ff_probe->streams( get_attached_file( $video['id'] ) )->videos()->first()->get( 'duration' ); }
Categories