Question

I have a test.asf file that I'd like to get the 'title' property from. There's also some other properties in there that would be nice to access, like 'comments' and 'length'.

Currently I'm getting those properties by checking the file in Windows; my script is running on a FreeBSD server.

Is this possible using just PHP? Anyone have experience with this, possible using an external tool/script that can be called from PHP?

I already tried:

stat($path)

But that just returned an error. Also, from the docs it doesn't seem like it's what I need.

On a final note, if there's no tool readily available, perhaps it's possible of converting the binary data and trying to look up properties myself, using some kind of low-level code?

EDIT: I tried the GetId3 lib, but that will only return me the mime-type and a warning:

"ASF header GUID {75B22630-668E-11CF-A6D9-00AA0062CE6C} does not match expected "GETID3_ASF_Header_Object" GUID {00000000-0000-0000-0000-000000000000}"
Was it helpful?

Solution

I dealt with this issue in the past. In my case I was trying to retrieve info from an mp4 files: title, bitrate, size, framerate ...

I used mediainfo which is available for many platforms as a CLI. You can call mediainfo from PHP using exec() then retrieve the information from the output and parse for the information you are looking for.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top