1

I see in WordPress 3.6 that you can read metadata from video and audio files. I have read through the codex (http://codex.wordpress.org/Function_Reference/wp_read_video_metadata), and even tried to implement getting the bitrate on a video, but with no results. Does anyone know the answers to the following questions:

  1. Can this function be used to read the metadata on my videos hosted on Amazon S3, basically can this function be used for external video and audio?
  2. Can I call this in a page template? I ask because the error I received when I tried the default example from the codex was that the function wp_read_video_metadata was not found. Which indicates the file wp-admin/includes/media.php is not being included on a standard page template.
  3. Finally, does anyone have a working example of getting audio or video metadata using these new functions?

Any help would be great. Thanks!

1 Answer 1

3
  1. Can this function be used to read the metadata on my videos hosted on Amazon S3, basically can this function be used for external video and audio?

I don't think so. The WordPress code uses the PHP function file_exists() which doesn't say it cannot check external files. The ID3 code, however, tries to determine the web server operating system, so it looks like you need local files for the ID3 detection.

  1. Can I call this in a page template?

You will have to include to run it from a page template. The ID3 files should be loaded when the wp_read_video_metadata() function is run.

require_once( ABSPATH . 'wp-admin/includes/media.php' );
  1. Finally, does anyone have a working example of getting audio or video metadata using these new functions?

I don't, but perhaps this will help:

According to the Quick Start mini FAQ in the ID3 readme.txt file:

Q: How can I check that getID3() works on my server/files?
A: Unzip getID3() to a directory, then access /demos/demo.browse.php

The files are on Sourceforge.

1
  • Thanks Charles. You are correct in that this appears to be for media uploaded to your own server. This function seems to pertain mainly to the metadata that is outputted in the Media Library. Maybe not intended to be used as a tool around the site. Thanks!
    – bcoyour
    Aug 2, 2013 at 21:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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