From 5e4eb51b4b732b35f0f25f69f1532d89f10b9a3f Mon Sep 17 00:00:00 2001 From: sc-idevops Date: Mon, 15 Jan 2024 18:59:49 -0500 Subject: [PATCH] added check for fps use gpu accel --- scripts/server_bin/fps_cut.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/server_bin/fps_cut.sh diff --git a/scripts/server_bin/fps_cut.sh b/scripts/server_bin/fps_cut.sh new file mode 100755 index 0000000..17a3fe0 --- /dev/null +++ b/scripts/server_bin/fps_cut.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +for i in `fdfind video.mp4`; do + if [ $(ffprobe -show_streams $i 2>&1 | grep fps | awk '{split($0,a,"fps")}END{print a[1]}' | awk '{print $NF}') -gt 30 ]; then + snap run ffmpeg -hide_banner -hwaccel cuda -hwaccel_output_format cuda -i "$i" -c:a copy -c:v h264_nvenc -filter:v fps=30 "${i}_30.mp4" + rm "$i" + mv "${i}_30.mp4" "$i" + fi + echo "no edit for $i" +done +