FFmpeg 调试冗长

Mar*_*usJ 2 ffmpeg

我正在使用 -loglevel debug 调试 ffmpeg,并且我想要调试消息(基本上只是将不同变量的值打印到终端)但在每一行前面是蓝色文本中的文件偏移量,我不想要看到那个,因为它对我没用。

我怎样才能做到这一点?

这是一个示例屏幕截图: 在此处输入图片说明

我希望删除蓝色文本 [dca @ 0x7fe86c80f000],但保留绿色文本

我尝试了 -nostats 和 -hide_banner 一起和分开,但也没有奏效。

小智 7

正如 Nifle 评论的那样,您可以像这样使用 sed。没有 sed,如果您的输出是:

$ ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi -loglevel debug

here is a line without any brackets and stuff, it should display too
[dca @ 0x7fe86c80f000] leave this stuff here
[dca @ 0x7fe86c80f000] and this
[dca @ 0x7fe86c80f000] this stuff too
another line that should just be printed plainly.
Run Code Online (Sandbox Code Playgroud)

然后你可以添加

| sed 's/\[.*\] *\t*//'
Run Code Online (Sandbox Code Playgroud)

最后,像这样:(在我的 linux 上运行,osX sed 可能会略有不同)

$ ffmpeg -i input.avi -b:v 64k -bufsize 64k output.avi -loglevel debug | sed 's/\[.*\] *\t*//'
here is a line without any brackets and stuff, it should display too
leave this stuff here
and this
this stuff too
another line that should just be printed plainly.
Run Code Online (Sandbox Code Playgroud)

看起来不错?