gpt4 book ai didi

Perl FFMpeg 打印输出

转载 作者:行者123 更新时间:2023-12-04 23:17:38 25 4
gpt4 key购买 nike

嗨,我使用以下 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%

最佳答案

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

关于Perl FFMpeg 打印输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9080323/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com