• 错误如下:
avformat.c: 在函数‘mod_avformat_alloc_output_context2’中:
avformat.c:385:4: 错误:‘AVFormatContext’没有名为‘url’的成员
s->url = strdup(filename);
  • 具体出错的代码
#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,7,100))
av_strlcpy(s->filename, filename, sizeof(s->filename));
#else
s->url = strdup(filename);
switch_assert(s->url);
#endif

就是这个版本号判断错了。这个版本的定义:

  • 解决办法

吾把代码的判断改了,顺利编译通过。