Skip to content

Get the dimensions of a Video file

pascalbaljet edited this page Jul 6, 2020 · 2 revisions

This gives you an instance of the FFMpeg\Coordinate\Dimension class.

// v7.0 and later:
FFMpeg::open('video.mp4')
    ->getVideoStream()
    ->getDimensions();

// pre v7.0:
FFMpeg::open('video.mp4')
    ->getStreams()
    ->videos()
    ->first()
    ->getDimensions();

See also: https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/master/src/FFMpeg/Coordinate/Dimension.php

Clone this wiki locally