基于Hi3516交差编译libvpx-1.6.1

      现在通过hi3516交叉编译libvpx-1.6.1,在海思平台上进行VP8视频编码器,将YUV格式的像素数据编码为VPx(VP8/VP9)码流,编码输出的封装格式是IVF!当然一般是通过FFmpeg接口来调用VP8/VP9接口!

编译步骤:

1、交叉编译配置,生成makefile文件: ./config

2、编译:make -j8

3、安装到指定位置:make install

在指定的目录下生成bin、lib、include、share等文件,把bin、lib两个文件夹的内容复制到开发板的sbin和lib目录下面就可以运行。

4、测试

编译libvpx时出现错误:(在linux上可以编译通过)
(1)、通过readme,如果编译器不在的列表里的使用CROSS命令:
sinovo@sinovo-virtual-machine:~/ffmpeg/vpx/libvpx$ CROSS=arm-hisiv300-linux-uclibcgnueabi- ./configure --prefix=/home/sinovo/ffmpeg/install --enable-libs --disable-examples --disable-docs --enable-vp8 --enable-vp9 --disable-shared --enable-static
  disabling examples
  disabling docs
  enabling vp8
  enabling vp9
  disabling shared
Configuring for target 'x86_64-linux-gcc'
  enabling x86_64
  enabling runtime_cpu_detect
  using yasm
  enabling postproc
Unable to invoke compiler: arm-hisiv300-linux-uclibcgnueabi-gcc  -m64 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Configuration failed. This could reflect a misconfiguration of your
toolchains, improper options selected, or another problem. If you
don't see any useful error messages above, the next step is to look
at the configure error log file (config.log) to determine what
configure was trying to do when it died.

(2)、在configure的编译器列表里添加海思交叉编译链"all_platforms="${all_platforms} arm-hisiv300-linux-uclibcgnueabi-gcc""
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ ./configure --target=arm-hisiv300-linux-uclibcgnueabi-gcc --prefix=/home/sinovo/ffmpeg/install --enable-static --enable-vp8 --enable-vp9 --enable-pic --disable-ccache --enable-pic --enable-static --as=yasm
  enabling vp8
  enabling vp9
  enabling pic
  disabling ccache
Configuring for target 'arm-hisiv300-linux-uclibcgnueabi-gcc'
  enabling arm
Bypassing toolchain for environment detection.
Creating makefiles for arm-hisiv300-linux-uclibcgnueabi-gcc libs
Creating makefiles for arm-hisiv300-linux-uclibcgnueabi-gcc examples
Creating makefiles for arm-hisiv300-linux-uclibcgnueabi-gcc tools
Creating makefiles for arm-hisiv300-linux-uclibcgnueabi-gcc docs
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ make 
    [DEP] examples/vp9cx_set_ref.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] video_writer.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] tools_common.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] ivfenc.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/vp8cx_set_ref.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/set_maps.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/decode_with_drops.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] video_reader.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] ivfdec.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/twopass_encoder.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/vp9_lossless_encoder.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/simple_encoder.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/decode_to_md5.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] md5_utils.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/postproc.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/simple_decoder.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/vpx_temporal_svc_encoder.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] examples/resize_util.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] vpxenc.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] vpxstats.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] warnings.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] rate_hist.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] y4minput.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] args.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] vpxdec.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
    [DEP] y4menc.c.d
/bin/sh: 1: I/home/sinovo/ffmpeg/libvpx-1.6.1/vp8: not found
make[1]: *** No rule to make target 'libvpx.a', needed by 'vpxdec'。 停止。
Makefile:17: recipe for target '.DEFAULT' failed
make: *** [.DEFAULT] Error 2
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ vi Makefile +17
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ find ./ -name y4minput.c.d
./vp8/y4minput.c.d
./y4minput.c.d


(3):配置
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ CROSS=arm-hisiv300-linux-uclibcgnueabi- ./configure --enable-static --as=yasm --target=armv7-linux-gcc --prefix=/home/sinovo/ffmpeg/install --disable-examples --disable-docs --disable-ccache --disable-multithread --disable-unit-tests --enable-shared --enable-vp8 --enable-vp9
  disabling examples
  disabling docs
  disabling ccache
  disabling multithread
  disabling unit_tests
  enabling shared
  enabling vp8
  enabling vp9
Configuring for target 'armv7-linux-gcc'
  enabling armv7
  enabling pic
  enabling neon
  enabling neon_asm
  enabling webm_io
  enabling libyuv
Creating makefiles for armv7-linux-gcc libs
Creating makefiles for armv7-linux-gcc tools
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ make -j8
    [CREATE] vpx_scale_rtcd.h
    [CREATE] vpx_dsp_rtcd.h
    [CREATE] vp8_rtcd.h
    [CREATE] vp9_rtcd.h
    [ASM CONVERSION] vpx_dsp/arm/idct16x16_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct16x16_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct16x16_1_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct16x16_1_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct8x8_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct8x8_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct8x8_1_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct8x8_1_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct4x4_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct4x4_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct4x4_1_add_neon.asm.S
    [DEP] vpx_dsp/arm/idct4x4_1_add_neon.asm.S.d
    [ASM CONVERSION] vpx_dsp/arm/idct_neon.asm.S
    [DEP] vpx_dsp/arm/idct_neon.asm.S.d
....
    [AR] libvpx_g.a
    [STRIP] libvpx.a < libvpx_g.a
    [CREATE] libvpx.ver
    [LD] libvpx.so.4.1.0
    [LN]      libvpx.so.4.1.0 libvpx.so
    [LN]      libvpx.so.4.1.0 libvpx.so.4
    [LN]      libvpx.so.4.1.0 libvpx.so.4.1
    [CREATE] vpx.pc
    [DEP] tools/tiny_ssim.c.d
    [CC] tools/tiny_ssim.c.o
    [LD] tools/tiny_ssim
sinovo@sinovo-virtual-machine:~/ffmpeg/libvpx-1.6.1$ make install
    [INSTALL] /home/sinovo/ffmpeg/install/lib/libvpx.a
    [LN]      libvpx.so.4.1.0 /home/sinovo/ffmpeg/install/lib/libvpx.so
    [LN]      libvpx.so.4.1.0 /home/sinovo/ffmpeg/install/lib/libvpx.so.4
    [LN]      libvpx.so.4.1.0 /home/sinovo/ffmpeg/install/lib/libvpx.so.4.1
    [INSTALL] /home/sinovo/ffmpeg/install/lib/libvpx.so.4.1.0
    [INSTALL] /home/sinovo/ffmpeg/install/lib/pkgconfig/vpx.pc

下载

https://download.csdn.net/download/u010872301/10446977

猜你喜欢

转载自blog.csdn.net/u010872301/article/details/80507486