GCC-如何使用FLV1(又名H.263)、MP3(格式和编解码器)和FLV(容器格式)编译FFMpeg

GCC - how to compile FFMpeg with FLV1 (aka H.263), MP3 (format and codec) and FLV (container format) only?

本文关键字:格式 FFMpeg 编解码器 编译 FLV FLV1 何使用 又名 GCC- MP3      更新时间:2023-10-16

所以我想编译FFMpeg C库(作为静态库),而不是完全默认的荣耀,只是为了我的目的-这样它就会包含:

  • 2种编解码器格式MP3和FLV1(H.263)
  • 2个文件(容器)格式MP3和FLV

当然,我只想限制格式和编解码器的范围。不是FFmpeg的功能。

怎么做这样的事?

我的主要观点是什么:

当我调用这样的函数时,要构建这样的ffmpeg

multiplexer::multiplexer(std::string container)
{
        av_register_all();
        this->format_context = avformat_alloc_context();
        if (this->format_context == NULL)
        {
                std::cout << "Multiplexer: format context is empty." << std::endl;
                throw internal_exception();
        }
        this->format_context->oformat = av_guess_format(container.c_str(), NULL, NULL);
        if (this->format_context->oformat == NULL)
        {
                std::cout << "Multiplexer: invalid container format (" << container << ")." << std::endl;
                throw internal_exception();
        }
}

我将仅限于FLV

configure脚本有一个选项列表。运行./configure --help查看它们。我不确定选项是如何堆叠的,但你可以先尝试--disable-everything,然后再尝试--enable-demuxer=flv等。