how can i get current size of video height and width !? I cant find any useful method
$ffprobe = FFMpeg\FFProbe::create();
$dimension = $ffprobe
->streams('/path/to/video/mp4') // extracts streams informations
->videos() // filters video streams
->first() // returns the first video stream
->getDimensions(); // returns a FFMpeg\Coordinate\Dimension object
This works fine but I am having trouble getting to the actual dimensions... How do I access the properties? I keep getting the error
Fatal error: Uncaught Error: Cannot access private property FFMpeg\Coordinate\Dimension::$height in /var/www/html/utilities/make_thumbnails/Assets_Insert_Setup_PHP.php:68 Stack trace: #0 /var/www/html/utilities/Assets/Assets_Insert.php(1): require() #1 {main} thrown in /var/www/html/utilities/make_thumbnails/Assets_Insert_Setup_PHP.php on line 68
I tried something like below and then wanted to send the value to my own array.
$height = $dimension->height;
@totomtornado Use $dimension->getWidth() and $dimension->getHeight().
On videos where the height > width, it's swapping the width and height values for some reason? Anyone else come across this?
Do you apply the RotateFilter? https://github.com/PHP-FFMpeg/PHP-FFMpeg/blob/f9cc3d0c429fade5a144db674272eb8b48db8dce/src/FFMpeg/Filters/Video/RotateFilter.php#L57-L65
If not, please file a new issue and provide a file to reproduce with. :)
Most helpful comment