Bitzi
home of the
Bitpedia
digital media encyclopedia

About, Products, Download, Search, Browse, Discuss, BitSocieties, Help




Bitzi works
best with Bitzi-Powered Applications.
Register or Sign In 

Bitzi Developer Discussion: bitcollider video plugin

Main Site : bboard : Bitzi Developer Discussion : One Message

Message:

bitcollider video plugin   [forward as email]
Well I finally got some spare time, so I spent the past two weeks or so rewriting the video metadata plugin and adding support for various formats. Currently supported are AVI, MPEG-1, MPEG-2, and QuickTime. The plugin grabs files with .avi, .mpg, .mpeg, .mov, and .m2v extensions, but doesn't use the extensions itself, because too many videos on the internet are mislabeled (instead it determines the format by looking at the beginning of the file). If you know of any other file extensions commonly used for any of these four formats, let me know so I can have the plugin grab them as well.

Tags currently returned:

tag.video.format = one of AVI, MPEG-1, MPEG-2, or QuickTime

tag.video.width/tag.video.height = width/height in pixels

tag.video.fps = framerate rounded to the nearest frame per second

tag.video.duration = duration in milliseconds

tag.video.bitrate = bitrate in kbps

tag.video.codec = video compression codec

Caveats:

- Some QuickTime movies will not return any information beyond the format=QuickTime tag. This is most likely because they are compressed-format QuickTime (you can check if this is the case by looking at it in a hex editor -- bytes 13-16 will be the string "cmov"). These movies are the same as normal QuickTime, except the entire file including the headers is compressed with a lossless algorithm (except a small header at the beginning that says "this file is compressed with [this algorithm]"). Decompressing the headers would involve either linking Bitzi with zlib or independently reimplementing zlib compression, neither of which seem like good solutions. So for now compressed QuickTime movies don't get metadata extracted. Luckily they appear to only be somewhere around 5-10% of total QT movies. Let me know if you find a non-cmov QT movie that fails to extract data though.

- Currently QuickTime does not return an fps tag, because I haven't figured out how to extract that information easily.

- Only AVI returns a codec tag currently, and it's just the 4-letter codec code embedded in the file (i.e. cvid for CinePak, IV42 for Indeo v4.2, etc.).

- One of the duration or bitrate tags may be estimated from the other one depending on the format (for example, it's not easy to get the duration of an MPEG movie, so duration is estimated from filesize and bitrate). This means that the duration may not be accurate to the millisecond, for example, but should be quite accurate enough to be useful metadata (since whether a video is 9 seconds or 9.1 seconds shouldn't matter much to Bitzi).

TODO:

- Extract codec information from QuickTime if possible, and convert 4-char codec codes to more useful codec names. (MPEG-1 and MPEG-2 don't have codecs, since all such streams must be compatible with each other).

- Add support for more formats, as I can find time and documentation on their file structure. I currently have RealVideo, Microsoft ASF, and Microsoft WMV in mind. Any others?

- Extract information about the audio streams embedded in the video files. If I do so, should the tags be the standard tag.audio.blah ones, or tag.video.audioblah, or tag.video.audio.blah?

Note on compiling:

There are multiple *.c source files that should all be linked into one plugin binary (currently video.c, mpeg.c, quicktime.c, and avi.c). This is pretty easy if you use the automake/configure scripts the bitcollider has; just make sure you have all the *.c files on the sources line in Makefile.am and then regenerate the Makefile.

Location:

Emailed to rob/mayhem, and available (at least temporarily) from http://rufus.d2g.com:8080/~delirium/bitcollider/video/

(make sure you get all 5 files: video.c, mpeg.c, quicktime.c, avi.c, and video.h).

Let me know if you have any problems, notice any bugs, have any suggestions, etc.

 
-- delirium, August 19, 2002 03:04 am

Replies:

Re: bitcollider video plugin   [forward as email]
Wow, thanks! This is great stuff, and much appreciated.

We could consider linking zlib into the Bitcollider, at some point: one other plugin that has been recommended is one which recursively bitprints the contents of a zip/tar archive, and submits tags indicating that the innard files are inside the enclosing file.

It's fine to return rather raw (e.g. 4-character codec names) data from the plug-in for submission -- closely matching what's in the file -- and then make the decision about pretty names elsewhere, at display code in the server or other applications.

Another format that may someday be of interest is the VP3 format -- donated by On2 to the open-source Ogg project. See Theora for details.

Right now I think reusing the standard tag.audio.* names is best on submissions. (If necessary, they can be reinterpreted server-side given other indications of a file's type. But I might change my mind on this if someone comes up with a good reason for creating separate 'video+audio' labels...)

I'll get a chance to compile/try this out in the next few days.

Again, thanks!

 
-- gojomo, August 22, 2002 12:58 pm

Re: bitcollider video plugin   [forward as email]
Works great on Linux, thanks! Sorry about taking so long to try it out.

4-char codec codes are fine.

The formats you listed and On2 sound like the right ones to tackle going forward.

For audio I like tag.audio.blah, but those don't exist presently. I should merge the mp3/vorbis/wav tags into an audio tag with a format field, as with the image and video tags.

 
-- ml, September 16, 2002 01:59 pm

Re: bitcollider video plugin   [forward as email]
I can't access the URL posted above at all. I'm in general confused about where I can download plugins. Anyone? :?

-Kalle.

 
-- kallewoof, June 29, 2005 02:59 pm

Re: bitcollider video plugin   [forward as email]
The video metadata plugin was included in the main bitcollider distribution (C version) in late 2002 sometime, so there shouldn't be a need to get it separately.
 
-- delirium, March 04, 2006 12:25 pm
[ Post a reply ]

© 2009 The Bitzi Corporation | Policies | Company Info | In The Press | Link To Us

296,787 bitizens have contributed 15,880,886 tags about 3,196,654 files.