在 FFMPEG 中使用 C++ 代码中最短的参数

Use argument shortest in C++ code in FFMPEG

我需要在 C++ 代码中设置参数“-shortest”。我知道我可以设置一个带有值的参数,例如:

 av_opt_set(codecContext, "crf", "28", 0);

但事情是这样的,它是有价值的,但总之是没有价值的。 那么如何在 C++ 代码中设置最短的

提前致谢

我在这里得到了答案:https://www.reddit.com/r/ffmpeg/comments/oeuwlw/how_to_set_up_shortest_flag_programmatically_c/

所以, -shortest 是 ffmpeg 二进制文件的一部分。使用 libav* 库时不可用。

您可以在 AVFormatContext 上设置“fflags”、“最短”和“max_interleave_delta”、“100M”。