首页 / 操作系统 / Linux / Ubuntu 10.10 下(交叉编译)编译安装 libvpx和ffmpeg——webm的编译安装
首先在google的网站下载ffmpeg-0.6.1_libvpx-v0.9.5-135-gc28b10a.diff.gz和libvpx-v0.9.5.tar.bz2http://code.google.com/p/webm/downloads/list在下载ffmpeg-0.6.1把补丁文件mv到ffmpeg-0.6.1目录下打补丁patch -p1 < ffmpeg-0.6.1_libvpx-v0.9.5-135-gc28b10a.diff首先编译安装libvpx配置文件为 ./configure --prefix=/usr/local/libvpx --enable-shared --enable-vp8交叉编译配置 ./configure --target=armv6-linux-gcc --prefix=/usr/local/libvpx-arm --enable-shared --enable-vp8提示错误yasm解决方法:sudo apt-get install yasmmakesudo make install然后编译安装ffmpeg配置文件为./configure --prefix=/usr/local/ffmpeg-vp8-x86 --enable-libvpx --enable-shared --cc=gcc --extra-cflags=-I/usr/local/libvpx/include --extra-ldflags=-L/usr/local/libvpx/lib提示错误libavcodec/libvpxenc.c:111: error: ‘VP8E_SET_CQ_LEVEL’ undeclared here (not in a function) libavcodec/libvpxenc.c:111: error: array index in initializer not of integer type libavcodec/libvpxenc.c:111: error: (near initialization for ‘ctlidstr’) libavcodec/libvpxenc.c: In function ‘vp8_init’: libavcodec/libvpxenc.c:284: error: ‘VPX_CQ’ undeclared (first use in this function) libavcodec/libvpxenc.c:284: error: (Each undeclared identifier is reported only once libavcodec/libvpxenc.c:284: error: for each function it appears in.) libavcodec/libvpxenc.c: At top level: libavcodec/libvpxenc.c:567: warning: initialization discards qualifiers from pointer target type解决方法 打开/usr/local/libvpx/include/vp8cx.h enum vp8e_enc_control_id { VP8E_UPD_ENTROPY = 5, /**< control function to set mode of entropy update in encoder */ VP8E_UPD_REFERENCE, /**< control function to set reference update mode in encoder */ VP8E_USE_REFERENCE, /**< control function to set which reference frame encoder can use */ VP8E_SET_ROI_MAP, /**< control function to pass an ROI map to encoder */ VP8E_SET_ACTIVEMAP, /**< control function to pass an Active map to encoder */ VP8E_SET_SCALEMODE = 11, /**< control function to set encoder scaling mode */ VP8E_SET_CPUUSED = 13, /**< control function to set vp8 encoder cpuused */ VP8E_SET_ENABLEAUTOALTREF, /**< control function to enable vp8 to automatic set and use altref frame */ VP8E_SET_NOISE_SENSITIVITY, /**< control function to set noise sensitivity */ VP8E_SET_SHARPNESS, /**< control function to set sharpness */ VP8E_SET_STATIC_THRESHOLD, /**< control function to set the threshold for macroblocks treated static */ VP8E_SET_TOKEN_PARTITIONS, /**< control function to set the number of token partitions */ VP8E_GET_LAST_QUANTIZER, /**< return the quantizer chosen by the encoder for the last frame using the internal scale */ VP8E_GET_LAST_QUANTIZER_64, /**< return the quantizer chosen by the encoder for the last frame, using the 0..63 scale as used by the rc_*_quantizer config parameters */ VP8E_SET_ARNR_MAXFRAMES, /**< control function to set the max number of frames blurred creating arf*/ VP8E_SET_ARNR_STRENGTH , /**< control function to set the filter strength for the arf */ VP8E_SET_ARNR_TYPE , /**< control function to set the type of filter to use for the arf*/ VP8E_SET_CQ_LEVEL , } ;VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int) VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int) VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int)
VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)的代码加两条红色部分编辑 libavcodec/libvpxenc.c:284将 VPX_CQ 改成VPX_VBR