when attaching videos (eg. .flv) to a post - is it possible to query its dimensions? the problem is - i've got videos in 4:3 and 16:9 format and i need to get this information.
any ideas?
thanks
|
|
php-flvinfo and php-mp4info are php classes for reading flv and mp4 metadata. you could read it on the fly, or it may be possible to hook a save to get this info in the db somewhere. |
|||
|
|
|
You would need a plugin to do this. It would need to parse the video and save the meta information. I'd recommend taking a look at this library for starters: http://code.google.com/p/flv4php/ As for implementing this as a WordPress plugin, you would need to write a function and hook it to the wp_generate_attachment_metadata filter. The code will basically look something like this:
Any meta data you add to $meta and return there will be stored along with the attachment post. You can then later retrieve it, without having to reparse the file or anything, with wp_get_attachment_metadata( $attachment_id ). |
|||
|
|
|
I don't use videos to test. My quick guess would be to try |
|||
|