From 1ab29f6ce50d43af391da6885dd1f696902bb8da Mon Sep 17 00:00:00 2001 From: Oliver Atkinson Date: Mon, 14 Aug 2023 04:04:50 -0600 Subject: [PATCH] fix perms & new script --- .local/bin/ssh-encode | 27 +++++++++++++++++++++++++++ .local/bin/start-pipewire | 0 2 files changed, 27 insertions(+) create mode 100755 .local/bin/ssh-encode mode change 100644 => 100755 .local/bin/start-pipewire diff --git a/.local/bin/ssh-encode b/.local/bin/ssh-encode new file mode 100755 index 0000000..64f015e --- /dev/null +++ b/.local/bin/ssh-encode @@ -0,0 +1,27 @@ +FILE=$1 +OTHER=$2 +EXTENSION=".new.mp4" +TEMP="/tmp/" + + +if [[ -z $1 ]]; +then + echo "Pass the file to encode as the first argument." + exit +fi + +if [[ -z $2 ]]; +then + echo "Pass the ssh alias of the remote device as the second argument." + exit +fi + +# move file to other's temp drive +scp $FILE $OTHER:$TEMP +# use ffmpeg to encode on other computer +ssh $OTHER "ffmpeg -y -i $TEMP$FILE -vcodec h264_nvenc -acodec aac -pix_fmt yuv420p -g 15 -movflags frag_keyframe+empty_moov $TEMP$FILE$EXTENSION" +# move file back +scp $OTHER:$TEMP$FILE$EXTENSION . +# delete temp file +ssh $OTHER "rm $TEMP$FILE; rm $TEMP$FILE$EXTESION" + diff --git a/.local/bin/start-pipewire b/.local/bin/start-pipewire old mode 100644 new mode 100755