test render with speedup and overlays

This commit is contained in:
Dominic 2023-10-30 14:05:34 +01:00
parent 30e2dde57d
commit fd5d3ab1fd
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -50,21 +50,44 @@ ffmpeg \
-c:v h264_vaapi -r 25 -t 5 -b:a 128000 \ -c:v h264_vaapi -r 25 -t 5 -b:a 128000 \
"$lecture/outro.mp4" "$lecture/outro.mp4"
#convert -background none -density 1000 -resize 150x ../assets/logo.svg "$lecture/logo.png"
#convert -background none -density 1000 -resize 128x ../assets/fastforward.svg "$lecture/fastforward.png"
inkscape -w 150 -h 150 ../assets/logo.svg -o "$lecture/logo.png"
inkscape -w 128 -h 128 ../assets/fastforward.svg -o "$lecture/fastforward.png"
ffmpeg \ ffmpeg \
-hide_banner \ -hide_banner \
-vaapi_device /dev/dri/renderD128 \ -vaapi_device /dev/dri/renderD128 \
-i "$lecture/intro.mp4" \ -i "$lecture/intro.mp4" \
-i "$lecture/recording.mp4" \ -i "$lecture/recording.mp4" \
-i "$lecture/outro.mp4" \ -i "$lecture/outro.mp4" \
-i "../assets/logo.svg" \ -i "$lecture/logo.png" \
-i "../assets/fastforward.svg" \ -i "$lecture/fastforward.png" \
-async 1 \ -async 1 \
-filter_complex " -filter_complex "
[1:v]trim=start=2:duration=8,setpts=PTS-STARTPTS[v_tmp0]; [1:v]trim=start=2:duration=8,setpts=PTS-STARTPTS[v_tmp0];
[1:a]atrim=start=2:duration=8,asetpts=PTS-STARTPTS[a_tmp0]; [1:a]atrim=start=2:duration=8,asetpts=PTS-STARTPTS[a_tmp0];
[0:v][0:a][v_tmp0][a_tmp0][2:v][2:a]concat=n=3:v=1:a=1[v_tmp1][a_tmp1];
[v_tmp1]format=nv12,hwupload[final_v]; [v_tmp0]split=3[t0_v_tmp1][t1_v_tmp1][t2_v_tmp1];
[a_tmp1]anull[final_a] [t0_v_tmp1]trim=duration=3[t3_v_tmp1];
[t1_v_tmp1]trim=start=3:duration=2,setpts=PTS-STARTPTS,setpts=PTS/3[t4_v_tmp1];
[t4_v_tmp1][4]overlay=x=main_w/2-overlay_w/2:y=main_h/2-overlay_h/2[t6_v_tmp1];
[t2_v_tmp1]trim=start=5,setpts=PTS-STARTPTS[t5_v_tmp1];
[a_tmp0]asplit=3[t0_a_tmp1][t1_a_tmp1][t2_a_tmp1];
[t0_a_tmp1]atrim=duration=3[t3_a_tmp1];
[t1_a_tmp1]atrim=start=3:duration=2,asetpts=PTS-STARTPTS,atempo=3[t4_a_tmp1];
[t2_a_tmp1]atrim=start=5,asetpts=PTS-STARTPTS[t5_a_tmp1];
[t3_v_tmp1][t3_a_tmp1][t6_v_tmp1][t4_a_tmp1][t5_v_tmp1][t5_a_tmp1]concat=n=3:v=1:a=1[v_tmp1][a_tmp1];
[0:v][0:a][v_tmp1][a_tmp1][2:v][2:a]concat=n=3:v=1:a=1[v_tmp2][a_tmp2];
[3]format=yuva444p,colorchannelmixer=aa=0.5[logo];
[v_tmp2][logo]overlay=x=main_w-overlay_w-130:y=main_h-overlay_h-65[v_tmp3];
[a_tmp2]anull[a_tmp3];
[v_tmp3]format=nv12,hwupload[final_v];
[a_tmp3]anull[final_a]
" \ " \
-map '[final_v]' -map '[final_a]' \ -map '[final_v]' -map '[final_a]' \
-c:v h264_vaapi -rc_mode CQP -global_quality 22 \ -c:v h264_vaapi -rc_mode CQP -global_quality 22 \