-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a rootfs with rustc compiler to compile and run h26forge. h26forge will generate h264 test files to be parsed with Gstreamer h264parse element. Signed-off-by: Benjamin Gaignard <[email protected]>
- Loading branch information
Benjamin Gaignard
committed
Dec 16, 2024
1 parent
5ba8918
commit e4166e1
Showing
2 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
BUILD_DEPS="\ | ||
g++ \ | ||
flex \ | ||
bison \ | ||
ninja-build \ | ||
git \ | ||
python3-pip \ | ||
pkg-config \ | ||
openssl \ | ||
ca-certificates \ | ||
jq \ | ||
wget \ | ||
unzip \ | ||
software-properties-common \ | ||
rustc \ | ||
cargo | ||
" | ||
|
||
GST_DEPS="\ | ||
libglib2.0-dev \ | ||
libgudev-1.0-dev | ||
" | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
|
||
# Install dependencies | ||
echo 'deb http://deb.debian.org/debian bookworm-backports main' >>/etc/apt/sources.list | ||
apt-get update | ||
apt-get install --no-install-recommends -y ${BUILD_DEPS} ${GST_DEPS} curl | ||
apt-mark manual python3 libpython3-stdlib python3 libglib2.0-0 libgudev-1.0 | ||
|
||
# Get latest meson from pip | ||
pip3 install meson --break-system-packages | ||
|
||
H26FORGE_URL=https://github.com/h26forge/h26forge.git | ||
H26FORGE=target/release/h26forge | ||
output_dir="test_videos" | ||
tool_args="--mp4 --mp4-rand-size --safestart" | ||
generation_args="--small --ignore-edge-intra-pred --ignore-ipcm --config config/default.json" | ||
|
||
# Configure git | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "KernelCI Bot" | ||
|
||
GSTREAMER_URL=https://gitlab.freedesktop.org/gstreamer/gstreamer.git | ||
|
||
mkdir -p /var/tests/gstreamer && cd /var/tests/gstreamer | ||
|
||
git clone --depth 1 $GSTREAMER_URL . | ||
|
||
meson setup build \ | ||
--wrap-mode=nofallback \ | ||
-Dauto_features=disabled \ | ||
-Dbad=enabled \ | ||
-Dbase=enabled \ | ||
-Dgood=enabled \ | ||
-Dugly=disabled \ | ||
-Dgst-plugins-bad:ivfparse=enabled \ | ||
-Dgst-plugins-bad:debugutils=enabled \ | ||
-Dgst-plugins-bad:v4l2codecs=enabled \ | ||
-Dgst-plugins-bad:videoparsers=enabled \ | ||
-Dgst-plugins-base:app=enabled \ | ||
-Dgst-plugins-base:playback=enabled \ | ||
-Dgst-plugins-base:tools=enabled \ | ||
-Dgst-plugins-base:typefind=enabled \ | ||
-Dgst-plugins-base:videoconvertscale=enabled \ | ||
-Dgst-plugins-good:matroska=enabled \ | ||
-Dgst-plugins-good:v4l2=enabled \ | ||
-Dtools=enabled \ | ||
-Ddevtools=disabled \ | ||
-Dges=disabled \ | ||
-Dlibav=disabled \ | ||
-Drtsp_server=disabled | ||
|
||
ninja -C build | ||
ninja -C build install | ||
|
||
mkdir -p /opt/h26forge && cd /opt/h26forge | ||
|
||
git clone --depth 1 $H26FORGE_URL . | ||
|
||
cargo update | ||
cargo build --release | ||
|
||
if [ ! -f $H26FORGE ]; then | ||
echo "h26forge not found" | ||
exit 1 | ||
fi | ||
|
||
mkdir -p $output_dir | ||
for i in $(seq -f "%04g" 0 99); do | ||
$H26FORGE $tool_args generate $generation_args -o $output_dir/video$i.264 | ||
gst-launch-1.0 filesrc location=$output_dir/video$i.264.mp4 ! parsebin ! fakesink | ||
done | ||
|
||
######################################################################## | ||
# Cleanup: remove files and packages we don't want in the images # | ||
######################################################################## | ||
rm -rf /var/tests | ||
|
||
apt-get remove --purge -y ${BUILD_DEPS} | ||
apt-get autoremove --purge -y | ||
apt-get clean |