"-ss"で何秒目から開始するか、"-t"で何秒間切り取るか、が指定できます。
$ ffmpeg -h
...
-t duration record or transcode "duration" seconds of audio/video
-ss time_off set the start time offset
...
なので、"-ss 3 -t 5"なら、元動画の3秒目から5秒間の動画が作成されます。
せっかくなので、このオプションを利用した処理を、以前ちらっと紹介した、
FFmpeg::Commandで書いてみました。
http://blog.suz-lab.com/2010/01/theschwartz-ffmpegcommand.html
--------【Perl】--------
my $ffmpeg = FFmpeg::Command->new();
$ffmpeg->input_options({
file => $input_file,
});
$ffmpeg->output_options({
file => $output_file,
format => 'flv'
});
$ffmpeg->options(
"-ss" => 3,
"-t" => 10
);
my $result = $ffmpeg->exec();
--------
元画像の3秒目からの10秒間を切り取り、FLVフォーマットで出力しています。
次は動画の結合だ...
--------
http://www.suz-lab.com

0 コメント:
コメントを投稿