当我想重定向 ffprobe 命令的 stdout 时,我大吃一惊:通常的stdout > (file)不起作用。经过几次网络搜索,我找到了答案:我必须使用stdout > (file) 2>&1,这样就可以了:https://stackoverflow.com/questions/29680391/ffmpeg-command-line-write-output-to-a-text-file。
什么可以解释为什么将输出重定向到文件的常用方法对我不起作用:我使用的 ffprobe 版本? shell?还是其他什么?
~$ ffprobe --version
ffprobe version 5.1.6-0+deb12u1 Copyright (c) 2007-2024 the FFmpeg developers
built with gcc 12 (Debian 12.2.0-14)
或者由程序员来选择重定向的行为方式,如下面这个评论所解释的:
@Apostolos it's up to the programmer, you may want to keep normal
output separate from error output.