作者:手机用户2502927203 | 来源:互联网 | 2023-08-07 19:22
首先在google的网站下载ffmpeg-0.6.1_libvpx-v0.9.5-135-gc28b10a.diff.gz和libvpx-v0.9.5.tar.bz2
http://code.google.com/p/webm/downloads/list
在下载ffmpeg-0.6.1
把补丁文件mv到ffmpeg-0.6.1目录下
打补丁
patch -p1
首先编译安装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 yasm
make
sudo 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, /**VP8E_UPD_REFERENCE, /**VP8E_USE_REFERENCE, /**VP8E_SET_ROI_MAP, /**VP8E_SET_ACTIVEMAP, /**VP8E_SET_SCALEMODE = 11, /**VP8E_SET_CPUUSED = 13, /**VP8E_SET_ENABLEAUTOALTREF, /**VP8E_SET_NOISE_SENSITIVITY, /**VP8E_SET_SHARPNESS, /**VP8E_SET_STATIC_THRESHOLD, /**VP8E_SET_TOKEN_PARTITIONS, /**VP8E_GET_LAST_QUANTIZER, /**encoder for the last frame using the internal
scale */
VP8E_GET_LAST_QUANTIZER_64, /**encoder for the last frame, using the 0..63
scale as used by the rc_*_quantizer config
parameters */
VP8E_SET_ARNR_MAXFRAMES, /**VP8E_SET_ARNR_STRENGTH , /**VP8E_SET_ARNR_TYPE , /**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_SET_ROI_MAP, vpx_roi_map_t *)
VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, vp8e_token_partitions)
VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH , unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE , unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL , unsigned 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