/
06-output_options.t
41 lines (33 loc) · 963 Bytes
/
06-output_options.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!perl
use strict;
use warnings;
use FFmpeg::Command;
use Test::More qw( no_plan );
my $ffmpeg = FFmpeg::Command->new;
$ffmpeg->input_file('in.mp4');
$ffmpeg->output_options({
file => 'out.mp4',
format => 'mp4',
video_codec => 'mpeg4',
bitrate => 600,
frame_size => '320x240',
audio_codec => 'libaac',
audio_sampling_rate => 48000,
audio_bit_rate => 64,
});
my $cmd = $ffmpeg->_compose_command;
is(
join(' ', @$cmd),
'ffmpeg -y -i in.mp4 -acodec libaac -b 600 -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4'
);
$ffmpeg = FFmpeg::Command->new;
$ffmpeg->input_options({ file => 'in.mp4' });
$ffmpeg->output_options({
file => 'out.mp4',
device => 'ipod',
});
$cmd = $ffmpeg->_compose_command;
is(
join(' ', @$cmd),
'ffmpeg -y -i in.mp4 -b 600 -acodec libfaac -f mp4 -vcodec mpeg4 -ar 48000 -s 320x240 -ab 64 out.mp4'
);