【发布时间】:2026-01-07 11:55:01
【问题描述】:
我们需要ffmpeg来做一些视频处理,比如视频格式转换、直播抓图……,ffmpeg就不深入了。
现在我想知道使用 ffmpeg 的更好方法是什么,我们正在使用 Golang 进行开发,要么像 shell 命令行那样调用 ffmpeg,要么使用 ffmpeg 的 libav* 库。
command line:
Pros:
easy to use, reliable (I got a quality loss problem with library mode), many tutorials
Cons:
the is is a separate process, out of our control, we can't get detailed information of the process, like the video conversion progressing data
the command line way seems not so cool, this is not well integrated in the whole project.
libav* library:
Pros:
we can have the process detailed data, progressing status....
...
Cons:
difficult to use, much less materials
谁能给出你的想法,哪个是使用 ffmpeg 的更好方法?
在这个问题之前,我又问了两个问题:
一个是关于调用libav*库导致质量损失的问题:
Why calling libav* library doesn't have same quality as ffmpeg command line?
一个是命令行进度状态检索问题:
How to get the realtime output for a shell command in golang?
【问题讨论】:
标签: ffmpeg