I need to open file with .mp4 extension in popup. It is playing nicely and all other things are perfectly done. But when that popup is opening. At that time I want it to open with same height and width as of the video. I have that kind of more then 25 videos on my page. So I will store that parameters in code and then use it in javascript when I will open the popup. So I want to know video files width and height before I am playing that file. I want to know these parameters in php.
Try the php-mp4info library.
include("MP4Info.php");
$info = MP4Info::getInfo('directory/to/file.mp4');
if($info->hasVideo) {
echo $info->video->width . ' x ' . $info->video->height;
}
The $info object is, for example, as follows:
stdClass Object
(
[hasVideo] => 1
[hasAudio] => 1
[video] => stdClass Object
(
[width] => 480
[height] => 272
[codec] => 224
[codecStr] => H.264
)
[audio] => stdClass Object
(
[codec] => 224
[codecStr] => AAC
)
[duration] => 6
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With