Files
homarr/tools/motion-reel/assemble.sh
T
+12 fcd7c979df feat!: release v2 (#6545)
Co-authored-by: Artur <145776561+arturict@users.noreply.github.com>
Co-authored-by: arturict <arturict@users.noreply.github.com>
Co-authored-by: Thomas <thomas@ajnart.fr>
Co-authored-by: Afonso Jorge Ramos <afonsojorgeramos@gmail.com>
Co-authored-by: Danura30082 <danura30082+github@gmail.com>
Co-authored-by: Kushie <122986913+kushiemoon-dev@users.noreply.github.com>
Co-authored-by: ajnart <thomas@ajnart.fr>
Co-authored-by: ajnart <thomas@ajnart.dev>
Co-authored-by: chenjun <chenjun@foxmail.com>
Co-authored-by: Wikibear <wikibear@users.noreply.github.com>
Co-authored-by: Bergasha <bergasha@gmail.com>
Co-authored-by: leafyelin <43306196+leafyelin@users.noreply.github.com>
Co-authored-by: Lucas Araujo <lucas.lra@gmail.com>
Co-authored-by: GreenMonito <86085570+GreenMonito@users.noreply.github.com>
Co-authored-by: Nerdy-Technician <roffo@nerdy-technician.social>
Co-authored-by: Jun <34545896+jcstrong@users.noreply.github.com>
Co-authored-by: Edmond Abraham <54119952+gitedmond@users.noreply.github.com>
Co-authored-by: thrawnx <tight.bulb9384@fastmail.com>
Co-authored-by: Chris <58918656+nordada@users.noreply.github.com>
Co-authored-by: yi111 <153097222+Yi-111-a@users.noreply.github.com>
Co-authored-by: Yanis <naamaneyanis@gmail.com>
Co-authored-by: Wikibear <me@sej.de>
Co-authored-by: alessiottavo <93441886+alessiottavo@users.noreply.github.com>
2026-10-02 21:00:14 +02:00

25 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# Joins rendered chunks with the soundtracks into the two deliverables:
# homarr-motion-reel.mp4 original reel (chunks-a) + everything new in v2 (chunks-b)
# homarr-motion-reel-v2.mp4 black pre-roll + the v2 half only
set -euo pipefail
cd "$(dirname "$0")"
list() { for d in "$@"; do ls "$d"/c_*.mkv | grep -v '\.part\.mkv$'; done | sed "s|^|file '$PWD/|; s|$|'|"; }
encode() { # concat-list soundtrack output [extra video filter]
ffmpeg -y -loglevel error -f concat -safe 0 -i "$1" -i "$2" -map 0:v -map 1:a \
-vf "${4:+$4,}scale=out_color_matrix=bt709:out_range=tv,format=yuv420p" \
-c:v libx264 -preset slow -crf 15 -profile:v high -tune film \
-colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range tv \
-c:a aac -b:a 320k -movflags +faststart -shortest "$3"
}
list chunks-a chunks-b > list-global.txt
list chunks-b > list-v2cut.txt
pre=$(python3 -c "import json; print(round(json.load(open('warp-v2cut.json'))['pre'] * 60))")
encode list-global.txt soundtrack-global.wav homarr-motion-reel.mp4
encode list-v2cut.txt soundtrack-v2cut.wav homarr-motion-reel-v2.mp4 "tpad=start=$pre:color=black"
for f in homarr-motion-reel.mp4 homarr-motion-reel-v2.mp4; do
ffprobe -v error -show_entries format=duration,size -of compact "$f"
done