Video::FrameGrab - Grab a frame from a video
use Video::FrameGrab; my $grabber = Video::FrameGrab->new(); my $jpg_data = $grabber->frame_grab( $avi_file, "00:00:10" ); $grabber->jpeg_save("snapshot.jpg");
Video::FrameGrab grabs a frame at the specified point in time from the specified video file and returns its JPEG data.
It uses mplayer for the heavy lifting behind the scenes and therefore requires it to be installed somewhere in the PATH. If mplayer is somewhere else, its location can be provided to the constructor:
my $grabber = Video::FrameGrab->new( mplayer => "/path/to/mplayer" );
Grabs a frame from the movie at time $time. Time is given as HH::MM::SS, just as mplayer likes it. Returns the raw jpeg data of the captured frame on success and undef if an error occurs.
Save a grabbed frame as a jpeg image in $file on disk.
Copyright 2009 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
2009, Mike Schilli <cpan@perlmeister.com>
To install Video::FrameGrab, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Video::FrameGrab
CPAN shell
perl -MCPAN -e shell install Video::FrameGrab
For more information on module installation, please visit the detailed CPAN module installation guide.