From a135bc0433e5146b18860b93106ec412af8572d0 Mon Sep 17 00:00:00 2001 From: Benjamin Gaignard Date: Fri, 13 Dec 2024 17:14:04 +0100 Subject: [PATCH] add h26forge test 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 --- config/core/rootfs-configs.yaml | 31 +++++++++ .../debos/scripts/bookworm-gst-h26forge.sh | 65 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 config/rootfs/debos/scripts/bookworm-gst-h26forge.sh diff --git a/config/core/rootfs-configs.yaml b/config/core/rootfs-configs.yaml index 4af4697bd9..ac057105c7 100644 --- a/config/core/rootfs-configs.yaml +++ b/config/core/rootfs-configs.yaml @@ -105,6 +105,37 @@ rootfs_configs: imagesize: 2GB debos_memory: 8G + bookworm-gst-h26forge: + rootfs_type: debos + debian_release: bookworm + arch_list: + - amd64 + - arm64 + - armhf + extra_packages_remove: + - bash + - e2fslibs + - e2fsprogs + - klibc-utils + - libext2fs2 + - libgnutls30 + - libklibc + - libncursesw6 + - libp11-kit0 + - libunistring2 + - sensible-utils + extra_packages: + - ca-certificates + - python3-requests + - python3-yaml + - rustc + - unzip + - wget + script: "scripts/bookworm-gst-h26forge.sh" + test_overlay: "overlays/fluster" + imagesize: 2GB + debos_memory: 8G + bookworm-igt: rootfs_type: debos debian_release: bookworm diff --git a/config/rootfs/debos/scripts/bookworm-gst-h26forge.sh b/config/rootfs/debos/scripts/bookworm-gst-h26forge.sh new file mode 100644 index 0000000000..cbb2c27fbc --- /dev/null +++ b/config/rootfs/debos/scripts/bookworm-gst-h26forge.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +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 "bot@kernelci.org" +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 build --release + +if [ ! -d h264forge ]; then + echo "can't clone $H26FORGE_URL" + exit 1 +fi +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