问题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. 得到Xml中 元素的值

    <?xml version="1.0" encoding="utf-8" ?><Response service="RouteSer ...

  2. 【Oracle】ORA-01157: cannot identify/lock data file 201 - see DBWR trace file

    今天数据库在查询数据的时候显示了这个错误: ORA-01157: cannot identify/lock data file 201 - see DBWR trace file ORA-01110: ...

  3. 八种Docker容器开发模式解析

    原文链接:http://www.csdn.net/article/2014-10-27/2822294 Docker优点已经说过很多次,这里不做详述,Docker现在越来越受到开发人员的青睐,而且利用 ...

  4. jQuery添加新的元素

    append() - 在被选元素的结尾插入内容 prepend() - 在被选元素的开头插入内容 after() - 在被选元素之后插入内容 before() - 在被选元素之前插入内容 $(&quo ...

  5. 服务器安装ESXI6.5系统

    服务器做raid5磁盘冗余配置步骤 1.打开服务器电源,进入服务器启动界面,按下F10后回车,等待服务器回应你的操作进入下一个页面 提示:  在进入服务启动页面,在页面的最下方就可以看到F9,F10, ...

  6. struts2,hibernate等模板配置文件在jar包中的路径,以及所需要的包

    一.struts2 1.struts的配置模板文件struts-default.xml的位置: struts-2.3.16.1 --> src --core --> src --> ...

  7. 【JavaScript框架封装】实现一个类似于JQuery的基础框架、事件框架、CSS框架、属性框架、内容框架、动画框架整体架构的搭建

    /* * @Author: 我爱科技论坛 * @Time: 20180715 * @Desc: 实现一个类似于JQuery功能的框架 * V 1.0: 实现了基础框架.事件框架.CSS框架.属性框架. ...

  8. VS2015 C#取消最大化按钮,设置鼠标不可调整窗体大小

    取消最大化按钮设置  设置窗体不可被鼠标调整大小

  9. redis_4 主从模式

    配置主服务器: 进入 redis 配置文件redis.conf. 修改 bind 127.0.0.1 为 bind 0.0.0.0 关闭防火墙,只有root用户能操作 .开启 命令为:ufw enab ...

  10. POJ 3228 Gold Transportation

    Gold Transportation Time Limit: 2000ms Memory Limit: 65536KB This problem will be judged on PKU. Ori ...