Coder Social home page Coder Social logo

lhtzgr / sophon_ffmpeg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sophgo/sophon_ffmpeg

0.0 0.0 0.0 215.31 MB

Sophgo AI chips drivers and runtime library base 1.5 release

License: GNU Lesser General Public License v2.1

Shell 0.09% JavaScript 0.01% Ruby 0.01% C++ 0.78% Python 59.35% Perl 0.01% C 36.29% Objective-C 0.04% Fortran 0.01% Verilog 0.01% Assembly 2.24% Awk 0.01% CSS 0.01% SourcePawn 0.01% Cuda 0.01% Makefile 0.66% HTML 0.21% PLSQL 0.03% Batchfile 0.01% Cython 0.28%

sophon_ffmpeg's Introduction

SOPHGO FFMpeg README

This is SOPHGO FFMpeg project optimized for SOPHGO BM1682/1684/1684x AI chips. It provides hardware accelerations for video codecs and image processing filters. Also some enhancement for streaming protocal are included.

Changes

With officical FFMpeg, following changes are done in this project.

** h264_bm, hevc_bm, jpeg_bm codecs are implemented using video hardware engine in SOPHGO Chips for h264/hevc/jpeg decoder or encoder

** bmscale is implemented using image processing hardware in SOPHGO Chips for image processing

** GB2818 streaming protocal support is added in FFMpeg

** Several domenstic CPUs are supported

** Many improvements are customized for Chinese market

Build Command

x86_64 linux with local gcc

1. export PKG_CONFIG_PATH=./extern_lib/prebuilt/x86_64/lib/pkgconfig:$PKG_CONFIG_PATH
2. configure
./configure --target-os=linux \
    --pkg-config=pkg-config \
    --optflags=" "  \
    --enable-libmp3lame \
    --enable-static --enable-shared --enable-pic \
    --enable-swscale --enable-libfreetype \
    --enable-bmcodec --disable-encoder=bmx264  \
    --enable-encoder=jpeg_bm --enable-decoder=jpeg_bm \
    --disable-decoder=vc1_bm --disable-decoder=wmv1_bm --disable-decoder=wmv2_bm \
    --disable-decoder=wmv3_bm --disable-decoder=mpeg1_bm --disable-decoder=mpeg2_bm --disable-decoder=mpeg4_bm  --disable-decoder=mpeg4v3_bm --disable-decoder=flv1_bm \
    --disable-decoder=h263_bm --disable-decoder=cavs_bm --disable-decoder=avs_bm --disable-decoder=vp3_bm --disable-decoder=vp8_bm --enable-openssl \
    --disable-decoder=h264_v4l2m2m  \
    --disable-vaapi --disable-hwaccel=h263_vaapi  --disable-hwaccel=h264_vaapi --disable-hwaccel=hevc_vaapi --disable-hwaccel=mjpeg_vaapi \
    --disable-hwaccel=mpeg2_vaapi --disable-hwaccel=mpeg4_vaapi --disable-hwaccel=vc1_vaapi --disable-hwaccel=vp8_vaapi \
    --disable-hwaccel=vp8_vaapi --disable-hwaccel=wmv3_vaapi \
    --extra-ldflags="-L./extern_lib/bm_hardware_accele/decode_x86_64/lib -L./extern_lib/3rdparty/libbmcv/lib/pcie -Wl,-rpath=./extern_lib/3rdparty/libbmcv/lib/pcie -L./extern_lib/prebuilt/x86_64/lib -Wl,-rpath=./extern_lib/prebuilt/x86_64/lib" \
    --extra-libs="-lm -lbmion -lbmvpulite -lbmvpuapi -lbmvppapi -lbmlib -lbmcv -lbmjpulite -lbmjpuapi -lbmvideo -lrt -lssl -lcrypto -ldl -lresolv -lstdc++ -lgb28181_sip" \
    --extra-cflags="-DBM1684 -I./extern_lib/3rdparty/libbmcv/include -DBM_PCIE_MODE=1 -I./extern_lib/bm_hardware_accele/decode_x86_64/include/ -I./extern_lib/prebuilt/include/freetype2 -I./extern_lib/prebuilt/include/ -I./extern_lib/prebuilt/include/gbclient"
3. make and install to DESTDIR

x86_64 linux with x86_64-linux-gcc 5.4.0

1. download toolchain 
    wget https://toolchains.bootlin.com/downloads/releases/toolchains/x86-64-core-i7/tarballs/x86-64-core-i7--glibc--stable-2017.05-toolchains-1-1.tar.bz2
2. export PKG_CONFIG_PATH=./extern_lib/prebuilt/x86_64/lib/pkgconfig:$PKG_CONFIG_PATH
3. configure
./configure --cross-prefix=x86_64-linux- --enable-cross-compile --target-os=linux --arch=x86_64 \
    --pkg-config=pkg-config \
    --optflags=" "  \
    --enable-libmp3lame \
    --enable-static --enable-shared --enable-pic \
    --enable-swscale --enable-libfreetype \
    --enable-bmcodec --disable-encoder=bmx264  \
    --enable-encoder=jpeg_bm --enable-decoder=jpeg_bm \
    --disable-decoder=vc1_bm --disable-decoder=wmv1_bm --disable-decoder=wmv2_bm \
    --disable-decoder=wmv3_bm --disable-decoder=mpeg1_bm --disable-decoder=mpeg2_bm --disable-decoder=mpeg4_bm  --disable-decoder=mpeg4v3_bm --disable-decoder=flv1_bm \
    --disable-decoder=h263_bm --disable-decoder=cavs_bm --disable-decoder=avs_bm --disable-decoder=vp3_bm --disable-decoder=vp8_bm --enable-openssl \
    --disable-decoder=h264_v4l2m2m  \
    --disable-vaapi --disable-hwaccel=h263_vaapi  --disable-hwaccel=h264_vaapi --disable-hwaccel=hevc_vaapi --disable-hwaccel=mjpeg_vaapi \
    --disable-hwaccel=mpeg2_vaapi --disable-hwaccel=mpeg4_vaapi --disable-hwaccel=vc1_vaapi --disable-hwaccel=vp8_vaapi \
    --disable-hwaccel=vp8_vaapi --disable-hwaccel=wmv3_vaapi \
    --extra-ldflags="-L./extern_lib/bm_hardware_accele/decode_x86_64/lib -L./extern_lib/3rdparty/libbmcv/lib/pcie -Wl,-rpath=./extern_lib/3rdparty/libbmcv/lib/pcie -L./extern_lib/prebuilt/x86_64/lib -Wl,-rpath=./extern_lib/prebuilt/x86_64/lib" \
    --extra-libs="-lm -lbmion -lbmvpulite -lbmvpuapi -lbmvppapi -lbmlib -lbmcv -lbmjpulite -lbmjpuapi -lbmvideo -lrt -lssl -lcrypto -ldl -lresolv -lstdc++ -lgb28181_sip" \
    --extra-cflags="-DBM1684 -I./extern_lib/3rdparty/libbmcv/include -DBM_PCIE_MODE=1 -I./extern_lib/bm_hardware_accele/decode_x86_64/include/ -I./extern_lib/prebuilt/include/freetype2 -I./extern_lib/prebuilt/include/ -I./extern_lib/prebuilt/include/gbclient"
4. make and install to DESTDIR

SOPHGO soc with aarch64-linux-gnu-gcc

1. download toolchain from linaro gnu toolchain
    wget https://releases.linaro.org/components/toolchain/gcc-linaro/6.3-2017.05/gcc-linaro-6.3-2017.05.tar.xz
2. export PKG_CONFIG_PATH=./extern_lib/prebuilt/lib/pkgconfig:$PKG_CONFIG_PATH
3. configure
./configure --enable-cross-compile --cross-prefix=aarch64-linux-gnu- --target-os=linux --arch=aarch64 \
    --pkg-config=pkg-config \
    --optflags=" "  \
    --enable-static --enable-shared --enable-pic \
    --enable-swscale --enable-libfreetype \
    --enable-libmp3lame \
    --enable-bmcodec --disable-encoder=bmx264  \
    --disable-sdl2 --disable-ffplay \
    --enable-encoder=jpeg_bm --enable-decoder=jpeg_bm \
    --disable-decoder=vc1_bm --disable-decoder=wmv1_bm --disable-decoder=wmv2_bm \
    --disable-decoder=wmv3_bm --disable-decoder=mpeg1_bm --disable-decoder=mpeg2_bm --disable-decoder=mpeg4_bm  --disable-decoder=mpeg4v3_bm --disable-decoder=flv1_bm \
    --disable-decoder=h263_bm --disable-decoder=cavs_bm --disable-decoder=avs_bm --disable-decoder=vp3_bm --disable-decoder=vp8_bm --enable-openssl \
    --disable-decoder=h264_v4l2m2m  \
    --disable-vaapi --disable-hwaccel=h263_vaapi  --disable-hwaccel=h264_vaapi --disable-hwaccel=hevc_vaapi --disable-hwaccel=mjpeg_vaapi \
    --disable-hwaccel=mpeg2_vaapi --disable-hwaccel=mpeg4_vaapi --disable-hwaccel=vc1_vaapi --disable-hwaccel=vp8_vaapi \
    --disable-hwaccel=vp8_vaapi --disable-hwaccel=wmv3_vaapi \
    --extra-ldflags="-L./extern_lib/bm_hardware_accele/decode_arm64/lib -L./extern_lib/prebuilt/lib -Wl,-rpath=./extern_lib/bm_hardware_accele/decode_arm64/lib:./extern_lib/prebuilt/lib"\
    --extra-libs="-lm -lbmion -lbmvpulite -lbmvpuapi -lbmvppapi -lbmjpulite -lbmcv -lbmlib -lbmjpuapi -lbmvideo -lrt -lssl -lcrypto -ldl -lresolv -lstdc++ -lgb28181_sip" \
    --extra-cflags="-DBM1684 -I./extern_lib/3rdparty/libbmcv/include -I./extern_lib/bm_hardware_accele/decode_arm64/include/ -I./extern_lib/prebuilt/include/freetype2 -I./extern_lib/prebuilt/include/ -I./extern_lib/prebuilt/include/gbclient"
4. make and install to DESTDIR

License

This project is licensed under the LGPL License, Version 3. Please refere to the LICNESE file for detailed information.

Authorts

- xun.li  
- tao.han
- yujing.shen
- huaishan.yuan
- yuyuan.yang
- xin.guo
- yu.yang
- mingxi.shen
- haotian.luo

Contributing

This project is maintained by Sophgo multimedia team. Welcome to submit codes and patches to us by email to [email protected]

sophon_ffmpeg's People

Contributors

sophon-xun avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.