0

I'm building a site that will handle a lot of media files, both image and video. Currently, I have video and image content types setup along with the ability to bulk-upload them.

I'm wondering if there is a way to scrape details from an uploaded video—such as duration, type, etc and store these in fields. I'm not sure how to approach this.

1 Answer 1

2

Presumably we are talking mp4/webm video here? Start with checking out getID3. Then it is pretty simple to do:

$id3 = new getID3;
$file = $id3->analyze($filename);

Must always have "new getID3".

2
  • Thank you! Could you tell me how I'd use this to pull info from a video on upload to populate some fields in a content item?
    – Vecta
    Oct 27, 2015 at 19:19
  • Depending on the type of video you want to import. For example with YouTube you can use Feeds: YouTube Parser. The simplest option is probably to write a custom module to populate the fields on node_form_submit().
    – macjules
    Nov 2, 2015 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.