ffmpeg 无法定位程序输入点avcodec_alloc_context3

从zeranoe 下载的开发库

 #include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <libavcodec/avcodec.h>
#include <libavutil/opt.h>
#include <libavutil/imgutils.h>
#pragma comment(lib, "avcodec.lib")  

#pragma comment(lib,"avutil.lib")


int main(int argc, char **argv)
{
    const char *filename, *codec_name;
    const AVCodec *codec;
    AVCodecContext *c = NULL;
    int i, ret, x, y;
    FILE *f;
    AVFrame *frame;
    AVPacket *pkt;
    uint8_t endcode[] = { 0, 0, 1, 0xb7 };

    if (argc <= 2) {
        fprintf(stderr, "Usage: %s <output file> <codec name>\n", argv[0]);
        exit(0);
    }
    filename = argv[1];
    codec_name = argv[2];

    avcodec_register_all();

    /* find the mpeg1video encoder */
    codec = avcodec_find_encoder_by_name(codec_name);
    if (!codec) {
        fprintf(stderr, "Codec '%s' not found\n", codec_name);
        exit(1);
    }

    c = avcodec_alloc_context3(codec);

    if (!c) {
        fprintf(stderr, "Could not allocate video codec context\n");
        exit(1);
    }


    av_opt_set(c->priv_data, "turn", "zerolatency", 0);



    return 0;
}
只要加上av_opt_set(c->priv_data, "turn", "zerolatency", 0); 就会出现无法定位输入点

版本弄错了吧? 可以下载这个版本的源码,看看是否存在这个函数。。。

ffmpeg函数经常变

编译选项里面有配置是否要开O3优化,开O3优化,就不容易定位到指定函数。你这里可以在config.h文件中把O3选项勾掉。