From 5e4eb51b4b732b35f0f25f69f1532d89f10b9a3f Mon Sep 17 00:00:00 2001 From: sc-idevops Date: Mon, 15 Jan 2024 18:59:49 -0500 Subject: [PATCH 1/4] 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 + From c9c9fda6ed2d2c0a5b2f060aa43fbe2b1f57d7e3 Mon Sep 17 00:00:00 2001 From: sc-idevops Date: Sat, 20 Jan 2024 19:06:00 -0500 Subject: [PATCH 2/4] ensure that ffmpeg completes successfully before removing source file --- scripts/server_bin/fps_cut.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/server_bin/fps_cut.sh b/scripts/server_bin/fps_cut.sh index 17a3fe0..02d3846 100755 --- a/scripts/server_bin/fps_cut.sh +++ b/scripts/server_bin/fps_cut.sh @@ -1,10 +1,9 @@ #!/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" + if [[ (( $(ffprobe -show_streams $i 2>&1 | grep fps | awk '{split($0,a,"fps")}END{print a[1]}' | awk '{print $NF}') > 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 From 14db86b04e2fadb9dab8573ee737bb244c08cc5a Mon Sep 17 00:00:00 2001 From: sc-idevops Date: Sun, 21 Jan 2024 20:31:31 -0500 Subject: [PATCH 3/4] added verbosity --- scripts/server_bin/fps_cut.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/server_bin/fps_cut.sh b/scripts/server_bin/fps_cut.sh index 02d3846..6503827 100755 --- a/scripts/server_bin/fps_cut.sh +++ b/scripts/server_bin/fps_cut.sh @@ -3,8 +3,8 @@ 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}') > 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" + rm --verbose "$i" ; mv --verbose "${i}_30.mp4" "$i" fi - echo "no edit for $i" + echo " << no edit for $i" done From 72a3d60680fccedbfcba4b06aeea6bc40a01fcfe Mon Sep 17 00:00:00 2001 From: sc-idevops Date: Sun, 21 Jan 2024 20:32:37 -0500 Subject: [PATCH 4/4] turned off annoying ACTIVITY IN WINDOW notification --- config/dot-tmux.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/dot-tmux.conf b/config/dot-tmux.conf index 268f025..985d5b7 100644 --- a/config/dot-tmux.conf +++ b/config/dot-tmux.conf @@ -30,7 +30,7 @@ source "/usr/share/powerline/bindings/tmux/powerline.conf" #Misc Enables set-option -g renumber-windows on setw -g monitor-activity on -set -g visual-activity on +set -g visual-activity off #Windows set -g base-index 1