Re: ASF - WMA header
- From: "Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx>
- Date: Sat, 10 Dec 2005 23:50:43 GMT
On Sat, 10 Dec 2005 22:00:37 +0100, "Alessandro Angeli
[MVP::DigitalMedia]" <nobody@xxxxxxxxxxxxxxxxxx> wrote:
>Neil Smith [MVP Digital Media] wrote:
>
>> Somebody was asking about this in another group for
>> file-reading using PHP (and I didn't know). Is there
>> anything documented to read the ASF [binary] data and
>> extract the media duration from that ?
>>
>> Or is there a text string which is embedded somewhere
>> that can be used ?
Answers own question : Nope, there are various title, version and
other metadata but no recognisable text strings for this.
>The duration is written in an unsigned 64-bit integer in the
>HeaderObject/FilePropertiesObject::PlayDuration field. See
>section 3.2 of the ASF specification on
>www.microsoft.com/asf.
Thanks Alessandro, I'll have another look at that doc. If the
attribute value was in a fixed position within the header it would be
easy to find, however I have a feeling it can be at a variable
position within the first few hundred bytes of the asf.
>I am no PHP expert, but since PHP is a child of Perl, you
Consider it a "nephew" rather than "child" ;-)
>should be able to read a binary file and thus parse it
True, and that's what I'm kind-of-hoping.
>according to the ASF syntax. If the PHP code is run on
>Windows and the PHP runtime has the same capabilities of
>ActivePerl, there is a COM/ActiveX module that should allow
>the use of the WMF SDK. Parsing the file may be easier than
>using this Perl module.
I suggested the COM extensions to the OP (again, if on windows),
though that would possibly require loading the entire of WMP (plus the
file) to read the file's duration. Not too sure how to instantiate the
WMF COM object - though I figure I can get to the WMP object easily
enough, it could be overkill.
If I can find a good way to read the asf header directly to extract
the duration, then only the first few kb of the file need be loaded
and parsed, which gives a much lower overhead.
Cheers for that - Neil
.
- Follow-Ups:
- Re: ASF - WMA header
- From: Alessandro Angeli [MVP::DigitalMedia]
- Re: ASF - WMA header
- References:
- Re: ASF - WMA header
- From: Alessandro Angeli [MVP::DigitalMedia]
- Re: ASF - WMA header
- From: Alessandro Angeli [MVP::DigitalMedia]
- Re: ASF - WMA header
- From: Neil Smith [MVP Digital Media]
- Re: ASF - WMA header
- From: Alessandro Angeli [MVP::DigitalMedia]
- Re: ASF - WMA header
- Prev by Date: Re: In HTML, I have used an ActiveX MediaPlayer Control...
- Next by Date: Re: ASF - WMA header
- Previous by thread: Re: ASF - WMA header
- Next by thread: Re: ASF - WMA header
- Index(es):
Relevant Pages
|