问题1:
我用的是最新版本的ffmpeg和x264,刚刚编译出来,编译没有问题,但是在linux 环境使用ffmpeg的库时发现报错
error C3861: 'UINT64_C': identifier not found

解决方法在libavutil目录下的common.h里增加如下定义:

#ifndef INT64_C 
#define INT64_C(c) (c ## LL) 
#define UINT64_C(c) (c ## ULL) 
#endif

问题2:链接基于ffmpeg的应用时报错:
/usr/local/lib/libavcodec.a(libx264.o): In function `X264_frame':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:105: undefined reference to `x264_encoder_encode'
/usr/local/lib/libavcodec.a(libx264.o): In function `X264_close':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:143: undefined reference to `x264_encoder_close'
/usr/local/lib/libavcodec.a(libx264.o): In function `X264_init':
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:153: undefined reference to `x264_param_default'
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:295: undefined reference to `x264_encoder_open_83'
/home/qiuzhongming/disk2/source_pc/ffmpeg-0.6/libavcodec/libx264.c:305: undefined reference to `x264_encoder_headers'
collect2: ld returned 1 exit status

解决方法是:编译时候没有带上x264库,带上就好了。

问题3:使用ffmpeg x264进行编码的时候,avcodec_open报错:
[libx264 @ 00021bb0]broken ffmpeg default settings detected
[libx264 @ 00021bb0]use an encoding preset (vpre)
解决方法:在 x264 的source file encoder/encoder.c 中找到该报错的地方
/* Detect default ffmpeg settings and terminate with an error. */
    {
        int score = 0;
        score += h->param.analyse.i_me_range == 0;
        score += h->param.rc.i_qp_step == 3;
        score += h->param.i_keyint_max == 12;
        score += h->param.rc.i_qp_min == 2;
        score += h->param.rc.i_qp_max == 31;
        score += h->param.rc.f_qcompress == 0.5;
        score += fabs(h->param.rc.f_ip_factor - 1.25) < 0.01;
        score += fabs(h->param.rc.f_pb_factor - 1.25) < 0.01;
        score += h->param.analyse.inter == 0 && h->param.analyse.i_subpel_refine == 8;
        if( score >= 5 )
        {
            x264_log( h, X264_LOG_ERROR, "broken ffmpeg default settings detected\n" );
            x264_log( h, X264_LOG_ERROR, "use an encoding preset (vpre)\n" );
            return -1;
        }
    }

We can see that if score >= 5,the function to open the codec will fail.
We must at least set 4 param of the AVCodecContext before open it.
在avcodec_open函数之间增加如下几个AVCodecContext 的初始化:
/*default settings for x264*/
        ctx->me_range = 16;
        ctx->max_qdiff = 4;
        ctx->qmin = 10;
        ctx->qmax = 51;
        ctx->qcompress = 0.6;

OK,解决。

ffmpeg x264编译与使用介绍的更多相关文章

  1. 编译Android下可用的FFmpeg+x264

    编译Android下可用的FFmpeg+x264 编译x264: 下载最新版的x264 ftp://ftp.videolan.org/pub/videolan/x264/snapshots/ 1.解压 ...

  2. 基于v4l2 ffmpeg x264的视频远程监控(附上编译好的库文件)

    说明:主要是基于ghostyu网友整理的< arm mini2440 基于v4l2 ffmpeg x264的视频远程监控>.自己做了一遍,遇到不少问题,就整理记录下来. 1.平台 硬件:a ...

  3. centos编译ffmpeg x264

    1.安装汇编编译器(一般系统自带吧).假设没有依照以下的命令安装吧 yum install yasm 2.使用最新x264源代码编译(仅仅支持编码)    在x264官网下载最新的代码http://w ...

  4. ubuntu下使用脚本交叉编译windows下使用的ffmpeg + X264

    这里主要是补充一些遇到的问题和解决方法. 2013-06 下旬 由于项目需要,重新编译ffmpeg+264+其他. 这里使用的环境Ubuntu 13.04,脚本依然是cross_compile_ffm ...

  5. ffmpeg+x264 Windows MSVC 静态编译

    尝试ubuntu和win下mingw编译版本,但都在Vistual Studio链接时因为依赖 libgcc.a, libmingw.a, libmingwex.a 会与mscrt 有符号冲突. 最后 ...

  6. android编译ffmpeg+x264

    下载最新版的x264ftp://ftp.videolan.org/pub/videolan/x264/snapshots/1.解压到指定的目录2.切换当前目录为该目录3.创建一个shell脚本buil ...

  7. windows 下FFMPEG的编译方法 附2012-9-19发布的FFMPEG编译好的SDK下载

    经过一晚上加一上午的奋斗,终于成功编译出了最新版的FFMPEG,下面是我编译的心得,因为是最新的,应该会对大家有用,编译的FFMPEG的版本是0.11.2,2012-09-19新发布的版本 平台:WI ...

  8. ffmpeg x264安装

    fmpeg安装第三方编码器(encoder)库,ffmpeg编码h264(完) ffmpeg安装第三方编码器(encoder)库 关键词:ffmpeg.编码h264.第三方encoder 安装好了ff ...

  9. Ubuntu 移植 ffmpeg + x264

    背景 直接编译移植的ffmpeg是与 arm-linux 下类似的. 详情参考: arm linux 移植 FFMPEG库 + x264 host平台 :Ubuntu 16.04 x264 :2017 ...

随机推荐

  1. Java基础9一面向对象

    继承 1.特点 a) 要有一定的层次结构,并且具备可传递性. b) 判断两者之间是否有继承关系通过is-a来判断. c) 子类继承了父类,那么子类就继承了父类中所有的属性和方法,但是父类中的私有属性和 ...

  2. Android App退出检测

    app的退出检测是很难的,但是获取app“要退出”的状态就容易多了,退出的瞬间并不是真的退出了,ActivityManager要销毁activity,也需要一些时间和资源的. 先见下面的运行效果:  ...

  3. linq.sort

    reflections.Sort(delegate(ReflectionEntity a, ReflectionEntity b) { if (a.CreatedTime < b.Created ...

  4. RedHat/centOS 部分字符处理

    sed -i '/^$/d' filename #删除空行sed -i '/tablename/d' filename #删除含有匹配字符串的行sed -i '/_c1/d' filename #删除 ...

  5. 创建一个dynamics CRM workflow (六) - Debugging Custom Workflows

    我们也deploy部署了custom workflows, debugging是开发当中不可或缺的一个步骤. debug workflow的步骤和debug有些许不一样: 1. install pro ...

  6. form-control给input添加这个class类后就会使用bootstrap自带的input框

    <input type="text" class="form-control" id="name" placeholder=" ...

  7. 团体程序设计天梯赛-练习集-L1-026. I Love GPLT

    L1-026. I Love GPLT 这道超级简单的题目没有任何输入. 你只需要把这句很重要的话 —— “I Love GPLT”——竖着输出就可以了. 所谓“竖着输出”,是指每个字符占一行(包括空 ...

  8. Ikki's Story IV - Panda's Trick POJ - 3207_dfs跑2-SAT

    Code: #include<cstdio> #include<algorithm> #include<vector> using namespace std; c ...

  9. node——express框架

    express基于Node.js是一个web开发框架,web框架是为了我们开发更方便,更简洁,更高效. 英文网址 中文网址 安装: npm install express --save express ...

  10. 关于配置websocket,nginx转发https至wss问题

    在本地测试通过的socket,再放到现在的有nginx代理之后发现会报:failed: Error in connection establishment: net::ERR_NAME_NOT_RES ...