Replies: 1 comment
-
Quite sure this would require video processing software to be installed or using an external service, which I doubt would be required for Craft core. However if the video is available on your local filesystem, it can easily be done in a custom module by using FFMpeg. $probe = \FFMpeg\FFProbe::create();
$meta = $probe
->streams('path/to/your/video.mp4')
->videos()
->first();
$dimensions = $meta->getDimensions();
$width = $dimensions->getWidth();
$height = $dimensions->getHeight(); (We have seen those infos missing or incorrect though.) If you want to extract an image from the video, this can be also be done: $ffmpeg = \FFMpeg\FFMpeg::create();
$video = $ffmpeg->open($videoPath);
$frame = $video->frame(FFMpeg\Coordinate\TimeCode::fromSeconds(10));
$frame->save($imagePath); /Mel |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'd like to have native support for getting video meta data. Stuff that I'm most interested in are the video dimensions.
Use case: Transforming a poster image based on the video's dimensions.
Beta Was this translation helpful? Give feedback.
All reactions