Closed madstone-dev closed 2 years ago
There's a rotate filter in the underlying package: https://github.com/PHP-FFMpeg/PHP-FFMpeg#rotate
There's a rotate filter in the underlying package: https://github.com/PHP-FFMpeg/PHP-FFMpeg#rotate
I know a rotate filter exists. But, I don't know how much the video is rotated beforehand.
How do I know how much the video is rotated?
Hi @madstone-dev I was wondering how did you resolve this?
in my case the video came fine when uploaded, but: $size = $video->getVideoStream()->getDimensions();
provided inverted the $size->getWidth() and $size->getHeight() values Also iPhone video
Hi @nam-co I left an issue here, but couldn't solve it in the end.
Hi @madstone-dev I figure out a hack to try to fix it, if the rotation exists, I invert width and height
//CALCULARE RATIO AND SIZE
$data = FFMpeg::open($file)->getVideoStream()->all();
$rotation = $data['side_data_list'][0]['rotation'] ?? null;
if(!empty($rotation) AND $rotation != 0 AND $rotation != 270){
$widthTemp = $data['width']; $width = $data['height']; $height = $widthTemp;
}
Hello 🙂 I am trying to upload a video through this package. But some iPhone videos are uploaded at a 90 degree angle. These videos get reversed direction with
getDimensions
How do I rotate the image in the correct orientation?