Video::Info::Quicktime

Video::Info::Quicktime

Posted by: Antnee
Posted on: 2008-02-20 07:07:00

I need to get some header information from Quicktime movies and have been advised to try the Video::Info::Quicktime Perl module. Honestly I don't know anything about it like how to use it or even if I can. All I need is the length of the movie file, though I'd like to get the resolution as well if possible.

Any help?

Cheers

Re: Video::Info::Quicktime

Posted by: Alpicola
Posted on: 2008-02-20 07:21:00

Looking at CPAN, Video::Info::Quicktime is probably not a module that you want to be calling yourself. From the looks of things, it's meant to be a helper module for Video::Info, which is what you should be using instead.

The documentation for Video::Info on CPAN is pretty good. duration() will tell you how long the movie plays for, and resolution is easily calculated as width() * height().

Re: Video::Info::Quicktime

Posted by: Antnee
Posted on: 2008-02-20 07:31:00

OK, so I call Video::Info but it still requires that Video::Info::Quicktime is installed right? Is there a way to find out? I honestly know nothing about PERL at all

Re: Video::Info::Quicktime

Posted by: Alpicola
Posted on: 2008-02-20 08:02:00

I assume you're trying to install these modules using CPAN, which you've set up according to the wiki instructions?


Normally with helper modules, CPAN installs them automatically along with the main module. So, if you've installed Video::Info, you likely have Video::Info::Quicktime as well. Thus, once you have CPAN set up according to the wiki instructions, you can type

cpan Video::Info

into your UNIX shell and the system should take care of everything else for you.


You can easily check this in your UNIX shell by running:

perl -MVideo::Info::Quicktime -e exit0

If that runs with no errors and produces no output, then Video::Info::Quicktime is installed correctly. If it does show an error, try running

perl -MVideo::Info -e exit0

to see if it can find Video::Info correctly. If perl finds Video::Info but not Video::Info::Quicktime, then simply type

cpan Video::Info::Quicktime

to get it installed and double-check with perl to make sure it showed up ok.

If perl can't find either Video::Info, or Video::Info::Quicktime, make sure that the paths to your local CPAN directories that you set up according to the wiki instructions show up in @INC. If they don't, go back over the wiki instructions to make sure you didn't miss anything.


Hopefully that all goes smoothly. Don't hesitate to ask questions if I've confused you or if you could still use more help smile

Re: Video::Info::Quicktime

Posted by: Antnee
Posted on: 2008-02-20 08:50:00

OK, I think I understand that now. I'll see about following those instructions and see how it goes. I get the feeling I'm in for a world of stress here though :S

Re: Video::Info::Quicktime

Posted by: scjessey
Posted on: 2008-02-20 09:18:00

ffmpeg would probably be an easier route to go down if you were more comfortable working in PHP. Once installed, getting a duration would be a simple as:

$ffmpegObj = new ffmpeg_movie(“/path/to/movie/”);
$ffmpegObj->getDuration();

-- si-blog --

Re: Video::Info::Quicktime

Posted by: Antnee
Posted on: 2008-02-20 10:14:00

OK, I've had that suggested to me already. I can work with PHP already but have not worked with Perl at all, ever.

Somebody had already suggested ffmpeg to me previously as well but it was written off because I need the files on my server, at which point the Perl solution was mentioned. I assumed that meant that I didn't need to have the file on the server. Guess I was wrong :D

I'll need to look into capturing files from another server and probing them for the header information then as it's not something I've ever done before either. It's all new to me, and it's all for the sake of saving people having to type in the duration themselves. I am good to people aren't I? :D

Tags: cheerscheers