问题描述
我希望编译 ffmpeg,使其仅支持少数编解码器.具体来说,只有 PCM 编解码器和 MP3.
I'm looking to compile ffmpeg so that it supports only a handful of codecs.Specifically, only PCM codecs and MP3.
关于如何做到这一点的任何指示?可以用编译标志来完成,还是我需要编辑代码?
Any pointers on how to do that? Can it be done with compilation flags, or do I need to edit the code?
推荐答案
你可以使用 configure
和 --disable-everything
然后只启用你需要的,然后构建此配置.更多相关信息:构建 FFmpeg.这样你就不需要接触源代码(手动编辑).
You can use configure
with --disable-everything
and then enable only what you need, then build this configuration. More on this: Building FFmpeg. This way you don't need to touch source code (manual edits).
具体是什么受到影响和其他开关(摘自 configure
脚本):
Specifically what is affected and other switches (excerpt from configure
script):
Individual component options:
--disable-everything disable all components listed below
--disable-encoder=NAME disable encoder NAME
--enable-encoder=NAME enable encoder NAME
--disable-encoders disable all encoders
--disable-decoder=NAME disable decoder NAME
--enable-decoder=NAME enable decoder NAME
--disable-decoders disable all decoders
--disable-hwaccel=NAME disable hwaccel NAME
--enable-hwaccel=NAME enable hwaccel NAME
--disable-hwaccels disable all hwaccels
--disable-muxer=NAME disable muxer NAME
--enable-muxer=NAME enable muxer NAME
--disable-muxers disable all muxers
--disable-demuxer=NAME disable demuxer NAME
--enable-demuxer=NAME enable demuxer NAME
--disable-demuxers disable all demuxers
--enable-parser=NAME enable parser NAME
--disable-parser=NAME disable parser NAME
--disable-parsers disable all parsers
--enable-bsf=NAME enable bitstream filter NAME
--disable-bsf=NAME disable bitstream filter NAME
--disable-bsfs disable all bitstream filters
--enable-protocol=NAME enable protocol NAME
--disable-protocol=NAME disable protocol NAME
--disable-protocols disable all protocols
--enable-indev=NAME enable input device NAME
--disable-indev=NAME disable input device NAME
--disable-indevs disable input devices
--enable-outdev=NAME enable output device NAME
--disable-outdev=NAME disable output device NAME
--disable-outdevs disable output devices
--disable-devices disable all devices
--enable-filter=NAME enable filter NAME
--disable-filter=NAME disable filter NAME
--disable-filters disable all filters
这篇关于在没有大多数编解码器的情况下编译 FFMpeg的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!