ffmpeg命令行将输出写入文本文件

ffmpeg command line write output to a text file

我正在使用此脚本在 ffmpeg 中进行镜头检测。

ffprobe -show_frames -of compact=p=0 -f lavfi "movie=test.mp4,select=gt(scene\,0.3)"

我需要将输出写入文本文件,以便从 c 程序读取输出。我怎样才能做到这一点?感谢任何帮助。

您将输出重定向到一个文件:

ffprobe -show_frames -of compact=p=0 -f lavfi "movie=test.mp4,select=gt(scene\,0.3)" > output.txt 2>&1

如果您想要 stdoutstderr 的单独文件,您可以这样做:

[..] > out.txt 2> err.txt