I am trying to compile FFMPEG to support a single video type (*.mp4).

I have everything working when I compile for all, but I do not want the extra over-head when I will only use a single format.

Here's my compile FLAGS now (non-working for MP4). I am sure there are other codecs/decoders I need to specifically enable, but am just having a hard time finding them.

Compiler directives showing the build flags below:

FLAGS="$FLAGS --disable-everything"
FLAGS="$FLAGS --enable-encoder=mpeg4video" ## This is the question, what all needs enabling?

I just do not know video standards well enough to know exactly which codecs / encoders / etc. to turn on.

av_register_all();
avdevice_register_all();

byteCtx = av_alloc_put_byte(buffer, BUFFER_SIZE, 0, f, ReadFunc, NULL, SeekFunc);
if (!byteCtx) {
    return;
}
// Open video file (here's the failure, doesn't happen when compiled for all)
inputFormat = av_find_input_format("MP4");
if (!inputFormat) {
    LOGE(ANDROID_LOG_ERROR, "NDK:", "Null inputformat!");
    return;
}
有帮助吗?

解决方案

Here's the proper FLAGS for building my libs with only what I needed. There may be one or two that are still unnecessary, but the size of the lib is manageable now.

    FLAGS="$FLAGS --disable-everything"
FLAGS="$FLAGS --enable-decoder=mpeg4 --enable-decoder=mpegvideo"
FLAGS="$FLAGS --enable-decoder=aac --enable-decoder=h264"
FLAGS="$FLAGS --enable-parser=aac --enable-parser=mpeg4video"
FLAGS="$FLAGS --enable-parser=mpegaudio --enable-parser=mpegvideo"
FLAGS="$FLAGS --enable-parser=ac3 --enable-parser=h261"
FLAGS="$FLAGS --enable-parser=h264 --enable-parser=vc1"
FLAGS="$FLAGS --enable-demuxer=mpegvideo --enable-demuxer=aac"
FLAGS="$FLAGS --enable-demuxer=m4v --enable-demuxer=mov"
FLAGS="$FLAGS --enable-demuxer=h264 --enable-demuxer=vc1"
FLAGS="$FLAGS --enable-muxer=h264 --enable-muxer=mpeg2video"
FLAGS="$FLAGS --enable-muxer=mp4 --enable-muxer=mov"
FLAGS="$FLAGS --enable-protocol=file"
FLAGS="$FLAGS --enable-indev=v4l --enable-indev=v4l2"
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top