Perl FFMpeg打印输出

时间:2012-01-31 13:29:19

标签: perl ffmpeg system

您好我使用以下perl命令转换文件与ffmpeg:

system ("/usr/local/bin/ffmpeg -i $inputFile $outputFile");

我想知道是否可以打印ffmpeg输出?

干杯

更新

解决方案是使用反引号

my $output = qx{/usr/local/bin/ffmpeg -i $inputFile $outputFile 2>&1};
print $output

这打印出以下内容:

FFmpeg version SVN-r26402, Copyright (c) 2000-2011 the FFmpeg developers built on Jan 31 2012 12:30:35 with gcc 4.4.5 20110214 (Red Hat 4.4.5-6) configuration: --enable-libmp3lame --disable-mmx --enable-shared libavutil 50.36. 0 / 50.36. 0 libavcore 0.16. 1 / 0.16. 1 libavcodec 52.108. 0 / 52.108. 0 libavformat 52.93. 0 / 52.93. 0 libavdevice 52. 2. 3 / 52. 2. 3 libavfilter 1.74. 0 / 1.74. 0 libswscale 0.12. 0 / 0.12. 0 [wav @ 0x8af94c0] max_analyze_duration reached Input #0, wav, from 'a.wav': Duration: 00:00:05.84, bitrate: 1537 kb/s Stream #0.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s Output #0, mp3, to 'a.mp3': Metadata: TSSE : Lavf52.93.0 Stream #0.0: Audio: libmp3lame, 48000 Hz, 2 channels, s16, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Press [q] to stop encoding size= 42kB time=5.42 bitrate= 64.0kbits/s size= 46kB time=5.88 bitrate= 64.0kbits/s video:0kB audio:46kB global headers:0kB muxing overhead 0.070153%

1 个答案:

答案 0 :(得分:1)

提示:FFmpeg将其输出抛出到StandrdError而不是StandrdOutput