FFmpeg的可以用来作为一个库,而不是一个独立的程序? [英] Can FFmpeg be used as a library, instead of a standalone program?

查看:326
本文介绍了FFmpeg的可以用来作为一个库,而不是一个独立的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想视频转换功能添加到一个程序我写。 FFmpeg的这样做的命令行界面简直是的ffmpeg -i输入文件OUTPUTFILE ,但有没有办法使用它作为一个库,所以我可以做类似 ffmpeg_convert(inputFile,请OUTPUTFILE)

I'd like to add video conversion capabilities to a program I'm writing. FFmpeg's command line interface for doing this is simply ffmpeg -i InputFile OutputFile, but is there a way to make use of it as a library, so I can do something like ffmpeg_convert(InputFile, OutputFile)?

我希望我不会直接使用libav codeC,因为我想象它会比一个单行函数格式之间进行转换复杂得多。如果FFmpeg的不能很容易地改装要做到这一点,是有基础上,做也许有个图书馆吗?我听说libvlc的,但似乎只暴露视频的播放的API,而不是视频转换。

I'm hoping I won't have to use libavcodec directly, as I imagine it will be far more complex than a one-line function to convert between formats. If FFmpeg can't be easily retrofitted to do this, is there perhaps another library based on it that does? I've heard of libvlc, but that seems to only expose a video playing API, not video conversion.

感谢。

推荐答案

您需要 libav codeC 了libavformat 。该 FAQ 告诉你:

4.1是否有举例说明如何使用FFmpeg的图书馆,尤其是libav codeC和libavformat流?

4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?

是的。阅读FFmpeg的文档的开发人员指南。另外,检查源$ C ​​$ C为众多开源项目已经在合并的FFmpeg( projects.html )之一。

Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively, examine the source code for one of the many open source projects that already incorporate FFmpeg at (projects.html).

FFmpeg的文档指南可以在 ffmpeg.org/documentation.html 发现,其中的Developer's指南。我建议在看了libavformat /输出example.c 或者在的ffmpeg 命令行实用程序本身的来源。

The FFmpeg documentation guide can be found at ffmpeg.org/documentation.html, including the Developer's guide. I suggest looking at libavformat/output-example.c or perhaps the source of the ffmpeg command line utility itself.

这篇关于FFmpeg的可以用来作为一个库,而不是一个独立的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆