Duration of a video file (.wmv)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
JustinK322
Forum Newbie
Posts: 9
Joined: Fri Jul 28, 2006 1:35 pm

Duration of a video file (.wmv)

Post by JustinK322 »

I have a system where users upload a video to a server. There is various pieces of information that the user enters for the video that is stored in a database. In addition to the user-entered information, I also want to get the size and duration of the video file that was uploaded automatically. To get the size of the file was simple using filesize(), but I have not been able to find a way to get the duration of a video file. Can anyone point me in the right direction to get the duration of a video file?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Nothing built into php can do it directly. Other than using a library such as ffmpeg or something similar, you'll have to parse the file and read it's contents to determine the length.
Post Reply