From e898a8a3321b3183966785e618df6cb04d010972 Mon Sep 17 00:00:00 2001 From: liuhaikang Date: Sat, 28 Dec 2024 10:41:12 +0800 Subject: [PATCH] Supports H264 encoding Signed-off-by: liuhaikang --- CHANGELOG.md | 4 ++++ doc/FFmpeg_n4.3.8/HPKBUILD | 4 ++-- entry/oh-package.json5 | 4 ++-- library/oh-package.json5 | 2 +- oh-package.json5 | 2 +- prebuild.sh | 13 +++++++++++-- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 833d40e..4a353a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.0.5-rc.2 + +- Supports H264 encoding + ## 2.0.5-rc.1 - Update to ffmpeg version 4.3.8 diff --git a/doc/FFmpeg_n4.3.8/HPKBUILD b/doc/FFmpeg_n4.3.8/HPKBUILD index 5ab2e25..a025bce 100644 --- a/doc/FFmpeg_n4.3.8/HPKBUILD +++ b/doc/FFmpeg_n4.3.8/HPKBUILD @@ -21,7 +21,7 @@ pkgdesc="FFmpeg is a collection of libraries and tools to process multimedia con url="https://github.com/FFmpeg/FFmpeg/" archs=("armeabi-v7a" "arm64-v8a" "x86_64") license=("GPL-2.0" "GPL-3.0" "LGPL-3.0" "LGPL-2.1") -depends=("rtmpdump" "openssl_1_0_2u" "lame") +depends=("rtmpdump" "openssl_1_0_2u" "lame" "openh264") makedepends=() source="https://github.com/FFmpeg/${pkgname:0:6}/archive/refs/tags/$pkgver.tar.gz" @@ -63,7 +63,7 @@ prepare() { build() { cd $builddir-$ARCH-build PKG_CONFIG_LIBDIR="${pkgconfigpath}" ./configure "$@" --enable-neon --enable-asm --enable-network \ - --enable-cross-compile --enable-librtmp --disable-x86asm --enable-openssl --enable-protocols --enable-libmp3lame \ + --enable-cross-compile --enable-librtmp --disable-x86asm --enable-openssl --enable-protocols --enable-libmp3lame --enable-openh264 \ --disable-static --enable-shared --disable-doc --disable-htmlpages --target-os=linux --arch=$arch \ --cc=${CC} --ld=${CC} --strip=${STRIP} --host-cc="${CC}" --host-ld="${CC}" --host-os=linux \ --host-ldflags=${ldflags} --sysroot=${OHOS_SDK}/native/sysroot --extra-cflags="-I${LYCIUM_ROOT}/usr/lame/${ARCH}/include" --extra-ldflags="-L${LYCIUM_ROOT}/usr/lame/${ARCH}/lib" > $buildlog 2>&1 diff --git a/entry/oh-package.json5 b/entry/oh-package.json5 index 90e2e63..77720a3 100644 --- a/entry/oh-package.json5 +++ b/entry/oh-package.json5 @@ -4,8 +4,8 @@ "name": "entry", "description": "一个读取、写入操作音视频文件编辑的工具。", "repository": {}, - "version": "2.0.5-rc.1", + "version": "2.0.5-rc.2", "dependencies": { - "@ohos/mp4parser": "2.0.5-rc.1" + "@ohos/mp4parser": "2.0.5-rc.2" } } diff --git a/library/oh-package.json5 b/library/oh-package.json5 index bdd3344..dc12cde 100644 --- a/library/oh-package.json5 +++ b/library/oh-package.json5 @@ -12,7 +12,7 @@ "description": "一个读取、写入操作音视频文件编辑的工具。支持视频裁剪、视频合成、音频裁剪、音频合成、视频取帧。", "main": "index.ets", "repository": "https://gitee.com/openharmony-tpc/mp4parser", - "version": "2.0.5-rc.1", + "version": "2.0.5-rc.2", "tags": [ "mp4parser", "Media" diff --git a/oh-package.json5 b/oh-package.json5 index 3d773bd..7410972 100644 --- a/oh-package.json5 +++ b/oh-package.json5 @@ -11,6 +11,6 @@ "name": "mp4parser", "description": "一个读取、写入操作音视频文件编辑的工具。", "repository": {}, - "version": "2.0.5-rc.1", + "version": "2.0.5-rc.2", "dependencies": {} } diff --git a/prebuild.sh b/prebuild.sh index 0e9a7ac..b65aa68 100644 --- a/prebuild.sh +++ b/prebuild.sh @@ -26,11 +26,12 @@ FFMPEG_NAME=FFmpeg_n4.3.8 # RTMPDUMP_NAME=rtmpdump # FFmpeg的依赖库名,需和依赖库一起安装 OPESSL_NAME=openssl_1_0_2u # FFmpeg的依赖库名,需和依赖库一起安装 LAME_NAME=lame # FFmpeg的依赖库名,需和依赖库一起安装 +OPENH264_NAME=openh264 # FFmpeg的依赖库名,需和依赖库一起安装 CI_OUTPUT_DIR=$ROOT_DIR/../out/tpc/ # hap/har安装目录 -LIBS_NAME=("FFmpeg_n4.3.8" "rtmpdump" "openssl_1_0_2u" "lame") -PACKAGE_NAME=("FFmpeg-n4.3.8.tar.gz" "rtmpdump-2.3.tgz" "openssl-OpenSSL_1_0_2u.tar.gz" "lame-3.100.tar.gz") +LIBS_NAME=("FFmpeg_n4.3.8" "rtmpdump" "openssl_1_0_2u" "lame" "openh264") +PACKAGE_NAME=("FFmpeg-n4.3.8.tar.gz" "rtmpdump-2.3.tgz" "openssl-OpenSSL_1_0_2u.tar.gz" "lame-3.100.tar.gz" "openh264-2.4.1.tar.gz") function prepare_lycium_tools() { @@ -138,6 +139,7 @@ function install_shasum() check_copy_shasum $SOUNDTOUCH_NAME ${PACKAGE_NAME[1]} $RTMPDUMP_NAME check_copy_shasum $OPESSL_NAME ${PACKAGE_NAME[2]} $OPESSL_NAME check_copy_shasum $LAME_NAME ${PACKAGE_NAME[3]} $LAME_NAME + check_copy_shasum $OPENH264_NAME ${PACKAGE_NAME[4]} $OPENH264_NAME } function start_build() { @@ -183,6 +185,12 @@ function install_depends() echo "FFmpeg depends lame build failed!" return 1 fi + cp -arf $LYCIUM_TOOLS_DIR/usr/openh264 $install_dir/openh264 + if [ $? -ne 0 ] + then + echo "FFmpeg depends openh264 build failed!" + return 1 + fi if [ -d $CI_OUTPUT_DIR ] then @@ -190,6 +198,7 @@ function install_depends() cp -arf $LYCIUM_TOOLS_DIR/usr/$OPESSL_NAME $CI_OUTPUT_DIR cp -arf $LYCIUM_TOOLS_DIR/usr/$RTMPDUMP_NAME $CI_OUTPUT_DIR cp -arf $LYCIUM_TOOLS_DIR/usr/$LAME_NAME $CI_OUTPUT_DIR + cp -arf $LYCIUM_TOOLS_DIR/usr/openh264 $CI_OUTPUT_DIR fi return 0 -- Gitee