FFmpeg::Command - A wrapper class for ffmpeg command line utility.
A simple interface for using ffmpeg command line utility.
use FFmpeg::Command; my $ffmpeg = FFmpeg::Command->new('/usr/local/bin/ffmpeg'); $ffmpeg->input_options({ file => $input_file, }); # Convert a video file into iPod playable format. $ffmpeg->output_options({ file => $output_file, device => 'ipod', }); my $result = $ffmpeg->exec(); croak $ffmpeg->errstr unless $result; # This is same as above. $ffmpeg->output_options({ file => $output_file, format => 'mp4', video_codec => 'mpeg4', bitrate => 600, frame_size => '320x240', audio_codec => 'aac', audio_sampling_rate => 48000, audio_bit_rate => 64, }); $ffmpeg->exec(); # Convert a video file into PSP playable format. $ffmpeg->output_options({ file => $output_file, device => 'psp', }); $ffmpeg->exec(); # This is same as above. $ffmpeg->output_options({ file => $output_file, format => 'psp', video_codec => 'mpeg4', bitrate => 600, frame_size => '320x240', audio_codec => 'aac', audio_sampling_rate => 48000, audio_bit_rate => 64, }); $ffmpeg->exec(); # Execute ffmpeg with any options you like. # This sample code takes a screnn shot. $ffmpeg->input_file($input_file); $ffmpeg->output_file($output_file); $ffmpeg->options( '-y', '-f' => 'image2', '-pix_fmt' => 'jpg', '-vframes' => 1, '-ss' => 30, '-s' => '320x240', '-an', ); $ffmeg->exec();
Contructs FFmpeg::Command object.It takes a path of ffmpeg command. You can omit this argument and this module searches ffmpeg command within PATH environment variable.
Specify input file name and input options.(Now no options are available.)
a file name of input file.
Specify output file name and output options.
Avaiable options are:
a file name of output file.
Output video format.
Output video codec.
Output video bitrate.
Output video screen size.
Output audio code.
Output audio sampling rate.
Output audio bit rate.
Set the title.
Set the author.
Set the comment.
Specify input file name using with options() method.
Specify output file name using with options() method.
Specify ffmpeg command options directly.
Executes ffmpeg comman with specified options.
An alias of execute()
Gosuke Miyashita, <gosukenator at gmail.com>
<gosukenator at gmail.com>
Please report any bugs or feature requests to bug-ffmpeg-command at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=FFmpeg-Command. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-ffmpeg-command at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc FFmpeg::Command
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/FFmpeg-Command
CPAN Ratings
http://cpanratings.perl.org/d/FFmpeg-Command
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=FFmpeg-Command
Search CPAN
http://search.cpan.org/dist/FFmpeg-Command
Copyright 2006 Gosuke Miyashita, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install FFmpeg::Command, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFmpeg::Command
CPAN shell
perl -MCPAN -e shell install FFmpeg::Command
For more information on module installation, please visit the detailed CPAN module installation guide.