Forum Moderators: coopster

Message Too Old, No Replies

Check a video's size

Viewing headers?

         

ahmedtheking

10:48 am on May 11, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How can I check, on the server with PHP, the screen size (res) of a video? IE, how can I use PHP to check the file's headers?

coopster

10:15 pm on May 11, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't know, Ming [php.net] perhaps?

Or are you asking how to read headers from a different site? You could always open your own socket and read the headers in that way.

ahmedtheking

6:56 am on May 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, I thought of opening a file and trying to read it's headers as most video files have the size in their headers, but for some strage reason, I really can't seem to find out how! I mean if I an fsockopen, it only seems to put headers, not read the file's headers.

gruber

7:21 am on May 12, 2006 (gmt 0)

10+ Year Member



I get video size in my scrtips using mplayer

mplayer -vo null -ao null -frames 0 -identify file.avi

then parse output

ahmedtheking

7:33 am on May 12, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm on a shared server so I can't install apps and libs!

coopster

12:04 pm on May 12, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, gruber. That's a good idea, execute a system command using a tool that can tell you the information you need. Anybody have a solution for non-Windows platforms?