test render script can cut without desync
This commit is contained in:
parent
823d8ce5dc
commit
ffad525857
2 changed files with 96 additions and 0 deletions
24
230101/setup.sh
Executable file
24
230101/setup.sh
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/busybox ash
|
||||
set -euo pipefail
|
||||
|
||||
for i in 1 2 3; do rm "C0$i.svg" || true; rm "C0$i.mp4" || true; done
|
||||
|
||||
function write_svg() {
|
||||
echo '<svg viewBox="0 0 1920 1080" width="1920" height="1080">'
|
||||
echo ' <rect fill="'"$1"'" x="0" y="0" width="1920" height="1080"/>'
|
||||
echo '</svg>'
|
||||
}
|
||||
|
||||
write_svg blue >C01.svg
|
||||
write_svg green >C02.svg
|
||||
write_svg red >C03.svg
|
||||
|
||||
function render_svg() {
|
||||
ffmpeg -hide_banner -vaapi_device /dev/dri/renderD128 \
|
||||
-loop 1 -i "$1" \
|
||||
-filter_complex "[0]format=nv12,hwupload[v];aevalsrc=sin($3*2*PI*t):s=48000[a]" \
|
||||
-map "[v]" -map "[a]" \
|
||||
-c:v h264_vaapi -r 25 -t 4 -b:a 128000 "$2"
|
||||
}
|
||||
|
||||
for i in 1 2 3; do render_svg "C0$i.svg" "C0$i.mp4" $(($i*40+400)); done
|
Loading…
Add table
Add a link
Reference in a new issue