Del.icio.us Links

/
December 2005
M T W T F S S
« Nov   Jan »
 1234
567891011
12131415161718
19202122232425
262728293031  

Chat Clussman

personal thoughts

1 The coolest PHP plugin ever

Okay, maybe I’m overdoing it a bit. It depends. Have you ever needed to pull complex data from a media file? Maybe the ID3 data? Maybe the width and height so you can display the object properly?

Then check out this getID3 script.

This thing is flat out amazing. I used it to get the width and height of a Quicktime movie that I needed to embed into a web page. Because it was for a site where people would be uploading a bunch of different media files and because I couldn’t rely on them to know the width and height of every file, I needed to get the information on the fly.

What it gave me was a wealth of information above and beyond just the width and the height. Here, for your viewing pleasure, is the array it returned (minus a big chunk of nested variables that, to me, looked like random data spit out by an overzealous loop):

$obInfo = Array (
[GETID3_VERSION] => 1.7.4
[filesize] => 7828770
[avdataoffset] => 9758
[avdataend] => 7828770
[fileformat] => quicktime
[audio] => Array (
[dataformat] => quicktime
[codec] =>
[sample_rate] => 22050
[channels] => 2
[bits_per_sample] => 16
[lossless] =>
[channelmode] => stereo
[streams] => Array (
[0] => Array (
[dataformat] => quicktime
[codec] =>
[sample_rate] => 22050
[channels] => 2
[bits_per_sample] => 16
[lossless] =>
[channelmode] => stereo
)
)
) [video] => Array (
[dataformat] => quicktime
[resolution_x] => 360
[resolution_y] => 240
[codec] => Sorenson Video
[bits_per_sample] => 24
[lossless] => [pixel_aspect_ratio] => 1
[frame_rate] => 15
) [tags] => Array (
[quicktime] => Array (
[title] => Array ( [0] => PrizeWhores Trailer )
[author] => Array ( [0] => Jenn Garrison )
[copyright] => Array ( [0] => Jenn Garrison )
[information] => Array ( [0] => www.prizewhores.com )
)

) [comments] => Array ( [language] => Array ( [0] => English ) )
[encoding] => ISO-8859-1
[filename] => pwtrailerqt.mov
[filepath] => /path/to/files
[filenamepath] => /path/to/files/pwtrailerqt.mov
[mime_type] => video/quicktime
[quicktime] => Array (
[time_scale] => 600
[display_scale] => 1
[video] => Array (
[resolution_x] => 360
[resolution_y] => 240
[codec_fourcc] => SVQ1
[codec_fourcc_lookup] => Sorenson Video 3
[codec] => Sorenson Video
[color_depth] => 24
[color_depth_name] => millions (24-bit color)
) [audio] => Array (
[codec] => [sample_rate] => 22050
[channels] => 2
[bit_depth] => 16
) [comments] => Array (
[title] => Array ( [0] => PrizeWhores Trailer )
[author] => Array ( [0] => Jenn Garrison )
[copyright] => Array ( [0] => Jenn Garrison )
[information] => Array ( [0] => www.prizewhores.com )
) [free] => Array (
[name] => free
[size] => 1040
[offset] => 8702
) [wide] => Array (
[name] => wide
[size] => 8
[offset] => 9742
) [mdat] => Array (
[name] => mdat
[size] => 7819020
[offset] => 9750
)
[encoding] => ISO-8859-1
)
[playtime_seconds] => 146.81333333333
[bitrate] => 426065.49813823
[tags_html] => Array (
[quicktime] => Array (
[title] => Array ( [0] => PrizeWhores Trailer )
[author] => Array ( [0] => Jenn Garrison )
[copyright] => Array ( [0] => Jenn Garrison )
[information] => Array ( [0] => www.prizewhores.com )
)
)
[playtime_string] => 2:27
)

Add this post to del.icio.us

You can leave a response, or trackback from your own site.