Skip to content

Commit

Permalink
add rockchip build
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcA711 committed Jan 17, 2025
1 parent e338f23 commit 64cdc29
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 22 deletions.
28 changes: 7 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
name: Build FFmpeg
name: Build Rockchip-FFmpeg

on:
push:
paths-ignore:
- '**.md'
- 'LICENSE'
workflow_dispatch:
inputs:
doRelease:
Expand All @@ -17,8 +13,6 @@ on:
type: boolean
default: false
required: false
schedule:
- cron: '0 12 * * *'

env:
DOCKER_BUILDKIT: 1
Expand All @@ -31,7 +25,7 @@ jobs:
steps:
- name: Repo Check
run: |
if [[ "$GITHUB_REPOSITORY" != "BtbN/FFmpeg-Builds" ]]; then
if [[ "$GITHUB_REPOSITORY" != "MarcA711/Rockchip-FFmpeg-Builds" ]]; then
echo "When forking this repository to make your own builds, you have to adjust this check."
echo "When doing so make sure to randomize the scheduled cron time above, in order to spread out the various build times as much as possible."
echo "This has been put in place due to the enormous amounts of traffic hundreds/thousands of parallel builds can cause on external infrastructure."
Expand Down Expand Up @@ -110,7 +104,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [win64,winarm64,linux64,linuxarm64]
target: [linuxarm64]
steps:
- name: Free Disk-Space
run: df -h && sudo apt-get clean && docker system prune -a -f && sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc && df -h
Expand Down Expand Up @@ -165,8 +159,8 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [win64,linux64,linuxarm64]
variant: [gpl,lgpl,gpl 5.1,gpl 6.1,gpl 7.1,lgpl 5.1,lgpl 6.1,lgpl 7.1,gpl-shared,lgpl-shared,gpl-shared 5.1,gpl-shared 6.1,gpl-shared 7.1,lgpl-shared 5.1,lgpl-shared 6.1,lgpl-shared 7.1]
target: [linuxarm64]
variant: [gpl 6.1-rk]
steps:
- name: Free Disk-Space
run: df -h && sudo apt-get clean && docker system prune -a -f && sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc && df -h
Expand Down Expand Up @@ -230,8 +224,8 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [win64,linux64,linuxarm64]
variant: [gpl,lgpl,gpl 5.1,gpl 6.1,gpl 7.1,lgpl 5.1,lgpl 6.1,lgpl 7.1,gpl-shared,lgpl-shared,gpl-shared 5.1,gpl-shared 6.1,gpl-shared 7.1,lgpl-shared 5.1,lgpl-shared 6.1,lgpl-shared 7.1]
target: [linuxarm64]
variant: [gpl 6.1-rk]
steps:
- name: Free Disk-Space
run: df -h && sudo apt-get clean && docker system prune -a -f && sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc && df -h
Expand Down Expand Up @@ -302,11 +296,3 @@ jobs:
gh release create "$TAGNAME" --target "master" --title "$NAME" latest_artifacts/*
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Update Wiki
run: ./util/update_wiki.sh artifacts ${{ steps.create_release.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Prune old releases
run: ./util/prunetags.sh
env:
GITHUB_TOKEN: ${{ github.token }}
3 changes: 3 additions & 0 deletions addins/6.1-rk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
FFMPEG_REPO="https://github.com/nyanmisaka/ffmpeg-rockchip"
GIT_BRANCH="6.1"
1 change: 1 addition & 0 deletions scripts.d/50-libvpx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ SCRIPT_REPO="https://chromium.googlesource.com/webm/libvpx"
SCRIPT_COMMIT="8058a0b54991257a0e1a2fcf08d993a8b70c1d3a"

ffbuild_enabled() {
# [[ $ADDINS_STR == *-rk ]] && return -1
[[ $TARGET == winarm64 ]] && return -1
return 0
}
Expand Down
38 changes: 38 additions & 0 deletions scripts.d/50-rkmpp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

# this is the upstream repo of mpp
# SCRIPT_REPO="https://github.com/rockchip-linux/mpp.git"
# SCRIPT_COMMIT="bebc9961103af2b53fb18175dd858b15a73c9ad8"

# this is a fork from nyanmisaka with some additional fixes
SCRIPT_REPO="https://github.com/nyanmisaka/mpp.git"
SCRIPT_COMMIT="fda5a02e8f88e79ef110e7912c20326a1fea51fb"
SCRIPT_BRANCH="jellyfin-mpp"

ffbuild_enabled() {
[[ $ADDINS_STR == *-rk ]] && return 0
return -1
}

ffbuild_dockerbuild() {
mkdir bld
cd bld

cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DBUILD_TEST=OFF -DBUILD_SHARED_LIBS=OFF ..
make -j$(nproc)
make install

rm -rf $FFBUILD_PREFIX/lib/librockchip_mpp.so*
}

ffbuild_configure() {
echo --enable-rkmpp
}

ffbuild_unconfigure() {
echo --disable-rkmpp
}

ffbuild_libs() {
echo -lstdc++
}
53 changes: 53 additions & 0 deletions scripts.d/50-rkrga.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/bash

# this is the upstream repo of mpp
# SCRIPT_REPO="https://github.com/JeffyCN/mirrors.git"
# SCRIPT_COMMIT="d7a0a485ed6c201f882c20b3a8881e801f131385"
# SCRIPT_BRANCH="linux-rga-multi"

# this is a fork from nyanmisaka with some additional fixes
SCRIPT_REPO="https://github.com/nyanmisaka/rk-mirrors.git"
SCRIPT_COMMIT="e97e327662d1c0867d4cbcc01d5caf15250fc4e7"
SCRIPT_BRANCH="jellyfin-rga"

ffbuild_enabled() {
[[ $ADDINS_STR == *-rk ]] && return 0
return -1
}

ffbuild_dockerbuild() {
sed -i 's/shared_library/library/g' meson.build

mkdir builddir && cd builddir

local myconf=(
--prefix="$FFBUILD_PREFIX"
--buildtype=release
--default-library=static
)

if [[ $TARGET == win* || $TARGET == linux* ]]; then
myconf+=(
--cross-file=/cross.meson
)
else
echo "Unknown target"
return -1
fi

meson "${myconf[@]}" ..
ninja -j$(nproc)
ninja install
}

ffbuild_configure() {
echo --enable-rkrga
}

ffbuild_unconfigure() {
echo --enable-rkrga
}

ffbuild_libs() {
echo -lstdc++
}
2 changes: 1 addition & 1 deletion scripts.d/50-vulkan/45-vulkan.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

SCRIPT_REPO="https://github.com/KhronosGroup/Vulkan-Headers.git"
SCRIPT_COMMIT="v1.4.304"
SCRIPT_COMMIT="v1.3.276"
SCRIPT_TAGFILTER="v?.*.*"

ffbuild_enabled() {
Expand Down

0 comments on commit 64cdc29

Please sign in to comment.