test_assets: add script to generate 30 sec of black frames

This commit is contained in:
Oystein Kristoffer Tveit 2024-12-14 14:16:50 +01:00
parent 00cae63272
commit c985b696ec
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
4 changed files with 25 additions and 0 deletions

3
.gitignore vendored
View File

@ -1,2 +1,5 @@
target
Cargo.lock
test_assets/*
!test_assets/.gitkeep

View File

@ -31,6 +31,7 @@
pkgs.mpv
pkgs.grcov
pkgs.cargo-nextest
pkgs.ffmpeg
];
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
});

21
setup_test_assets.sh Executable file
View File

@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -euo pipefail
REQUIRED_COMMANDS=(
"git"
"ffmpeg"
)
for cmd in "${REQUIRED_COMMANDS[@]}"; do
if ! command -v "$cmd" &> /dev/null; then
echo "Command '$cmd' not found. Please install it and try again."
exit 1
fi
done
ROOT_DIR=$(git rev-parse --show-toplevel)
# Generate 30 seconds of 480p video with black background
ffmpeg -f lavfi -i color=c=black:s=640x480:d=30 -c:v libx264 -t 30 -pix_fmt yuv420p "$ROOT_DIR/test_assets/black-background-30s-480p.mp4"

0
test_assets/.gitkeep Normal file
View File