• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

VBScript to get header info from FLV (flash video) files

P

Paul Randall

#1
Hi,
I've just started playing with some FLVs I've downloaded. Looking at them
with a hex editor, it appears they start with a header that has info about
them, such as play time, whether they are audio, video, or both, etc.

I've looked at Adobe's manual on FLVs, video_file_format_spec_v9.pdf, and it
appears relatively easy to get to the metadata I'm looking for. I'd rather
not reinvent the wheel here, so I'm hoping someone will share a VBScript
that decodes this info, or a link to such a script.

-Paul Randall
 

My Computer

P

Pegasus [MVP]

#2
"Paul Randall" <paulr901@newsgroup> wrote in message
news:uGQK0b83KHA.1624@newsgroup

> Hi,
> I've just started playing with some FLVs I've downloaded. Looking at them
> with a hex editor, it appears they start with a header that has info about
> them, such as play time, whether they are audio, video, or both, etc.
>
> I've looked at Adobe's manual on FLVs, video_file_format_spec_v9.pdf, and
> it appears relatively easy to get to the metadata I'm looking for. I'd
> rather not reinvent the wheel here, so I'm hoping someone will share a
> VBScript that decodes this info, or a link to such a script.
>
> -Paul Randall
This one works for .jpg and .mp3 files. May it works for .flv files too:
'------------------------------
'Extract .jpg meta data details
'------------------------------
'List of properties
'==================
'1 Size
'2 Item type
'3 Date modified
'4 Date created
'5 Date accessed
'6 Attributes
'7 Offline status
'8 Offline availability
'9 Perceived type
'10 Owner
'11 Kind
'12 Date taken
'13 Contributing artists
'14 Album
'15 Year
'16 Genre
'17 Conductors
'18 Tags
'19 Rating
'20 Authors
'21 Title
'22 Subject
'23 Categories
'24 Comments
'25 Copyright
'26 #
'27 Length
'28 Bit rate
'29 Protected
'30 Camera model
'31 Dimensions
'32 Camera maker
'33 Company
'34 File description
'35 Program name
'36 Duration
'37 Is online
'38 Is recurring
'39 Location
'40 Optional attendee addresses

sFilename = "pic0019.jpg"
sFolderPathspec = "d:\My Pictures\2007\Dec"
Set objShell = CreateObject ("Shell.Application")
Set objFolder = objShell.Namespace(sFolderPathspec)

For i = 1 To 40
wscript.echo strFileName, i, " ", _
objFolder.GetDetailsOf(objFolder.Parsename(sFileName), i)
Next
 

My Computer

P

Paul Randall

#3
"Pegasus [MVP]" <news@newsgroup> wrote in message
news:u4BS7%2393KHA.4332@newsgroup

>
>
> "Paul Randall" <paulr901@newsgroup> wrote in message
> news:uGQK0b83KHA.1624@newsgroup

>> Hi,
>> I've just started playing with some FLVs I've downloaded. Looking at
>> them with a hex editor, it appears they start with a header that has info
>> about them, such as play time, whether they are audio, video, or both,
>> etc.
>>
>> I've looked at Adobe's manual on FLVs, video_file_format_spec_v9.pdf, and
>> it appears relatively easy to get to the metadata I'm looking for. I'd
>> rather not reinvent the wheel here, so I'm hoping someone will share a
>> VBScript that decodes this info, or a link to such a script.
>>
>> -Paul Randall
>
> This one works for .jpg and .mp3 files. May it works for .flv files too:
> '------------------------------
> 'Extract .jpg meta data details
> '------------------------------
> 'List of properties
> '==================
> '1 Size
> '2 Item type
> '3 Date modified
> '4 Date created
> '5 Date accessed
> '6 Attributes
> '7 Offline status
> '8 Offline availability
> '9 Perceived type
> '10 Owner
> '11 Kind
> '12 Date taken
> '13 Contributing artists
> '14 Album
> '15 Year
> '16 Genre
> '17 Conductors
> '18 Tags
> '19 Rating
> '20 Authors
> '21 Title
> '22 Subject
> '23 Categories
> '24 Comments
> '25 Copyright
> '26 #
> '27 Length
> '28 Bit rate
> '29 Protected
> '30 Camera model
> '31 Dimensions
> '32 Camera maker
> '33 Company
> '34 File description
> '35 Program name
> '36 Duration
> '37 Is online
> '38 Is recurring
> '39 Location
> '40 Optional attendee addresses
>
> sFilename = "pic0019.jpg"
> sFolderPathspec = "d:\My Pictures\2007\Dec"
> Set objShell = CreateObject ("Shell.Application")
> Set objFolder = objShell.Namespace(sFolderPathspec)
>
> For i = 1 To 40
> wscript.echo strFileName, i, " ", _
> objFolder.GetDetailsOf(objFolder.Parsename(sFileName), i)
> Next
Thanks, Pegasus

I didn't even think about using the folder view options to turn on those
column in a folder window. But when I did, nothing showed up. Maybe WXP
SP2 doesn't know how to get this info from adobe flash video files. I'll
bet Windows 7 displays the info I want for flash files, though.

Using your script, I get similar results: no data for properties 9 and up.

-Paul Randall
 

My Computer

P

Pegasus [MVP]

#4
"Paul Randall" <paulr901@newsgroup> wrote in message
news:OXn8MII4KHA.1660@newsgroup

>
> "Pegasus [MVP]" <news@newsgroup> wrote in message
> news:u4BS7%2393KHA.4332@newsgroup

>>
>>
>> "Paul Randall" <paulr901@newsgroup> wrote in message
>> news:uGQK0b83KHA.1624@newsgroup

>>> Hi,
>>> I've just started playing with some FLVs I've downloaded. Looking at
>>> them with a hex editor, it appears they start with a header that has
>>> info about them, such as play time, whether they are audio, video, or
>>> both, etc.
>>>
>>> I've looked at Adobe's manual on FLVs, video_file_format_spec_v9.pdf,
>>> and it appears relatively easy to get to the metadata I'm looking for.
>>> I'd rather not reinvent the wheel here, so I'm hoping someone will share
>>> a VBScript that decodes this info, or a link to such a script.
>>>
>>> -Paul Randall
>>
>> This one works for .jpg and .mp3 files. May it works for .flv files too:
>> '------------------------------
>> 'Extract .jpg meta data details
>> '------------------------------
>> 'List of properties
>> '==================
>> '1 Size
>> '2 Item type
>> '3 Date modified
>> '4 Date created
>> '5 Date accessed
>> '6 Attributes
>> '7 Offline status
>> '8 Offline availability
>> '9 Perceived type
>> '10 Owner
>> '11 Kind
>> '12 Date taken
>> '13 Contributing artists
>> '14 Album
>> '15 Year
>> '16 Genre
>> '17 Conductors
>> '18 Tags
>> '19 Rating
>> '20 Authors
>> '21 Title
>> '22 Subject
>> '23 Categories
>> '24 Comments
>> '25 Copyright
>> '26 #
>> '27 Length
>> '28 Bit rate
>> '29 Protected
>> '30 Camera model
>> '31 Dimensions
>> '32 Camera maker
>> '33 Company
>> '34 File description
>> '35 Program name
>> '36 Duration
>> '37 Is online
>> '38 Is recurring
>> '39 Location
>> '40 Optional attendee addresses
>>
>> sFilename = "pic0019.jpg"
>> sFolderPathspec = "d:\My Pictures\2007\Dec"
>> Set objShell = CreateObject ("Shell.Application")
>> Set objFolder = objShell.Namespace(sFolderPathspec)
>>
>> For i = 1 To 40
>> wscript.echo strFileName, i, " ", _
>> objFolder.GetDetailsOf(objFolder.Parsename(sFileName), i)
>> Next
>
> Thanks, Pegasus
>
> I didn't even think about using the folder view options to turn on those
> column in a folder window. But when I did, nothing showed up. Maybe WXP
> SP2 doesn't know how to get this info from adobe flash video files. I'll
> bet Windows 7 displays the info I want for flash files, though.
>
> Using your script, I get similar results: no data for properties 9 and up.
>
> -Paul Randall
A moment ago I ran my script on a WinXP PC against an .mp3 file and got an
output for fields 1-10, 12, 16-23, 32-34. The meaning of the fields was
largely different from what the script says. It appears that different types
of multi-media files use the same header but with different field meanings.
 

My Computer

P

Paul Randall

#5
"Pegasus [MVP]" <news@newsgroup> wrote in message
news:%23MsBNjL4KHA.1716@newsgroup

>
>
> "Paul Randall" <paulr901@newsgroup> wrote in message
> news:OXn8MII4KHA.1660@newsgroup

>>
>> "Pegasus [MVP]" <news@newsgroup> wrote in message
>> news:u4BS7%2393KHA.4332@newsgroup

>>>
>>>
>>> "Paul Randall" <paulr901@newsgroup> wrote in message
>>> news:uGQK0b83KHA.1624@newsgroup
>>>> Hi,
>>>> I've just started playing with some FLVs I've downloaded. Looking at
>>>> them with a hex editor, it appears they start with a header that has
>>>> info about them, such as play time, whether they are audio, video, or
>>>> both, etc.
>>>>
>>>> I've looked at Adobe's manual on FLVs, video_file_format_spec_v9.pdf,
>>>> and it appears relatively easy to get to the metadata I'm looking for.
>>>> I'd rather not reinvent the wheel here, so I'm hoping someone will
>>>> share a VBScript that decodes this info, or a link to such a script.
>>>>
>>>> -Paul Randall
>>>
>>> This one works for .jpg and .mp3 files. May it works for .flv files too:
>>> '------------------------------
>>> 'Extract .jpg meta data details
>>> '------------------------------
>>> 'List of properties
>>> '==================
>>> '1 Size
>>> '2 Item type
>>> '3 Date modified
>>> '4 Date created
>>> '5 Date accessed
>>> '6 Attributes
>>> '7 Offline status
>>> '8 Offline availability
>>> '9 Perceived type
>>> '10 Owner
>>> '11 Kind
>>> '12 Date taken
>>> '13 Contributing artists
>>> '14 Album
>>> '15 Year
>>> '16 Genre
>>> '17 Conductors
>>> '18 Tags
>>> '19 Rating
>>> '20 Authors
>>> '21 Title
>>> '22 Subject
>>> '23 Categories
>>> '24 Comments
>>> '25 Copyright
>>> '26 #
>>> '27 Length
>>> '28 Bit rate
>>> '29 Protected
>>> '30 Camera model
>>> '31 Dimensions
>>> '32 Camera maker
>>> '33 Company
>>> '34 File description
>>> '35 Program name
>>> '36 Duration
>>> '37 Is online
>>> '38 Is recurring
>>> '39 Location
>>> '40 Optional attendee addresses
>>>
>>> sFilename = "pic0019.jpg"
>>> sFolderPathspec = "d:\My Pictures\2007\Dec"
>>> Set objShell = CreateObject ("Shell.Application")
>>> Set objFolder = objShell.Namespace(sFolderPathspec)
>>>
>>> For i = 1 To 40
>>> wscript.echo strFileName, i, " ", _
>>> objFolder.GetDetailsOf(objFolder.Parsename(sFileName), i)
>>> Next
>>
>> Thanks, Pegasus
>>
>> I didn't even think about using the folder view options to turn on those
>> column in a folder window. But when I did, nothing showed up. Maybe WXP
>> SP2 doesn't know how to get this info from adobe flash video files. I'll
>> bet Windows 7 displays the info I want for flash files, though.
>>
>> Using your script, I get similar results: no data for properties 9 and
>> up.
>>
>> -Paul Randall
>
> A moment ago I ran my script on a WinXP PC against an .mp3 file and got an
> output for fields 1-10, 12, 16-23, 32-34. The meaning of the fields was
> largely different from what the script says. It appears that different
> types of multi-media files use the same header but with different field
> meanings.
I tried some more googleing and found this: http://www.buraks.com/flvmdi/
It is a command line tool that creates an XML output with all the metadata:
<?xml version="1.0" encoding="UTF-8" ?>
- <root>
<duration>14.863</duration>
<videodatarate>329.974390079526</videodatarate>
<lastkeyframetimestamp>13.78</lastkeyframetimestamp>
<lastkeyframelocation>574281</lastkeyframelocation>
<creator>YouTube, Inc.</creator>
<metadatacreator>Manitu Group FLV MetaData Injector 2</metadatacreator>
<flvsource>cdbp</flvsource>
<haskeyframes>true</haskeyframes>
<hasmetadata>true</hasmetadata>
<lasttimestamp>14.838</lasttimestamp>
<videocodecid>2</videocodecid>
<audiocodecid>2</audiocodecid>
<audiodelay>0</audiodelay>
<canSeekToEnd>false</canSeekToEnd>
<width>320</width>
<height>180</height>
<audiodatarate>0</audiodatarate>
<framerate>29.9</framerate>
<creationdate>unknown</creationdate>
<metadatadate>4/20/2010 8:34:56 PM GMT-0600</metadatadate>
<filesize>612665</filesize>
<videosize>484003</videosize>
<audiosize>128013</audiosize>
<datasize>636</datasize>
<xtradata>\l</xtradata>
</root>

Thanks again for your assistance.

-Paul Randall
 

My Computer