From a634f2f6c00e76ec273c79e4552581ddaaed9896 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 1 Nov 2017 14:03:44 -0700 Subject: [PATCH] improved/simplified recording file-naming --- .config/Scripts/audio_alsa.sh | 16 +++++----------- .config/Scripts/audio_pulse.sh | 16 +++++----------- .config/Scripts/screencast_alsa.sh | 16 +++++----------- .config/Scripts/screencast_pulse.sh | 19 +++++++------------ .config/Scripts/video.sh | 19 +++++++------------ 5 files changed, 29 insertions(+), 57 deletions(-) diff --git a/.config/Scripts/audio_alsa.sh b/.config/Scripts/audio_alsa.sh index 6d31fa75..cda07a26 100755 --- a/.config/Scripts/audio_alsa.sh +++ b/.config/Scripts/audio_alsa.sh @@ -4,17 +4,11 @@ #Picks a file name for the output file based on availability: -if [[ -f ~/output.flac ]] - then - n=1 - while [[ -f $HOME/output_$n.flac ]] - do - n=$((n+1)) - done - filename="$HOME/output_$n.flac" - else - filename="$HOME/output.flac" -fi +while [[ -f $HOME/audio$n.flac ]] +do + n=$((n+1)) +done +filename="$HOME/audio$n.flac" #The actual ffmpeg command: diff --git a/.config/Scripts/audio_pulse.sh b/.config/Scripts/audio_pulse.sh index b16dcd70..21e46ea0 100755 --- a/.config/Scripts/audio_pulse.sh +++ b/.config/Scripts/audio_pulse.sh @@ -4,17 +4,11 @@ #Picks a file name for the output file based on availability: -if [[ -f ~/output.flac ]] - then - n=1 - while [[ -f $HOME/output_$n.flac ]] - do - n=$((n+1)) - done - filename="$HOME/output_$n.flac" - else - filename="$HOME/output.flac" -fi +while [[ -f $HOME/audio$n.flac ]] +do + n=$((n+1)) +done +filename="$HOME/audio$n.flac" #The actual ffmpeg command: diff --git a/.config/Scripts/screencast_alsa.sh b/.config/Scripts/screencast_alsa.sh index d2346894..95c1d5d9 100755 --- a/.config/Scripts/screencast_alsa.sh +++ b/.config/Scripts/screencast_alsa.sh @@ -4,17 +4,11 @@ #Picks a file name for the output file based on availability: -if [[ -f ~/output.mkv ]] - then - n=1 - while [[ -f $HOME/output_$n.mkv ]] - do - n=$((n+1)) - done - filename="$HOME/output_$n.mkv" - else - filename="$HOME/output.mkv" -fi +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" #The actual ffmpeg command: diff --git a/.config/Scripts/screencast_pulse.sh b/.config/Scripts/screencast_pulse.sh index 4befd85e..bb1b5b52 100755 --- a/.config/Scripts/screencast_pulse.sh +++ b/.config/Scripts/screencast_pulse.sh @@ -4,17 +4,11 @@ #Picks a file name for the output file based on availability: -if [[ -f ~/output.mkv ]] - then - n=1 - while [[ -f $HOME/output_$n.mkv ]] - do - n=$((n+1)) - done - filename="$HOME/output_$n.mkv" - else - filename="$HOME/output.mkv" -fi +while [[ -f $HOME/screencast$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/screencast$n.mkv" #The actual ffmpeg command: @@ -22,6 +16,7 @@ ffmpeg -y \ -f x11grab \ -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ -i :0.0 \ - -f pulse -ac 1 -ar 44100 -i alsa_input.usb-Blue_Microphones_Yeti_Stereo_Microphone_REV8-00.analog-stereo \ +-f alsa -i default \ -c:v libx264 -r 30 -c:a flac $filename #-c:v ffvhuff -r 30 -c:a flac $filename + #-f pulse -ac 1 -ar 44100 -i default \ diff --git a/.config/Scripts/video.sh b/.config/Scripts/video.sh index fadbfdab..ac3dc5c6 100755 --- a/.config/Scripts/video.sh +++ b/.config/Scripts/video.sh @@ -4,21 +4,16 @@ #Picks a file name for the output file based on availability: -if [[ -f ~/output.mkv ]] - then - n=1 - while [[ -f $HOME/output_$n.mkv ]] - do - n=$((n+1)) - done - filename="$HOME/output_$n.mkv" - else - filename="$HOME/output.mkv" -fi +while [[ -f $HOME/video$n.mkv ]] +do + n=$((n+1)) +done +filename="$HOME/video$n.mkv" + #The actual ffmpeg command: -ffmpeg -y \ +ffmpeg \ -f x11grab \ -s $(xdpyinfo | grep dimensions | awk '{print $2;}') \ -i :0.0 \