diff options
author | xyz <gky44px1999@gmail.com> | 2021-09-27 23:54:41 -0700 |
---|---|---|
committer | xyz <gky44px1999@gmail.com> | 2021-09-27 23:54:41 -0700 |
commit | 75109b930e10a5bf832340968e55467b0341b888 (patch) | |
tree | 5155cf554d2592bbf8cd1fbdc27e97b063bd5f8c /.local | |
parent | f98bfb120b8cd4085db3ba3cec6d7c49c1d2172d (diff) |
reco, use mktemp for tmpfile
Diffstat (limited to '.local')
-rwxr-xr-x | .local/bin/reco | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/.local/bin/reco b/.local/bin/reco index 1b5dbdac..acd977a6 100755 --- a/.local/bin/reco +++ b/.local/bin/reco @@ -6,13 +6,12 @@ # https://trac.ffmpeg.org/wiki/Capture/Desktop # better notify-send? keep send notify-send when recording? or not -# mktemp instead of time.uuid? -# benchmark diff. encode codecs to choose a better one? +# benchmark different encode codecs to choose a better one? # consider audio, camera ... # hardware acc? seems no for ffvhuff? see arch wiki # use tmp instead? -infofile="$XDG_CACHE_HOME/recoinfo" +infofile="/tmp/recoinfo" recodir="$XDG_VIDEOS_DIR/recordings/" mkdir -p "$recodir" @@ -24,9 +23,9 @@ if [ -e "$infofile" ]; then rm "$tmpfile" "$infofile" else notify-send 'start recording' - tmpfile="/tmp/$(time.uuid).mkv" + tmpfile="$(mktemp --suffix '.mkv')" # arch wiki way # no audio, less cpu use during capturing (fast?), large file size, need convert afterward - ffmpeg -f x11grab -framerate 25 -i "$DISPLAY" -c:v ffvhuff "$tmpfile" & + ffmpeg -y -f x11grab -framerate 25 -i "$DISPLAY" -c:v ffvhuff "$tmpfile" & printf '%s\n%s' "$!" "$tmpfile" > "$infofile" fi |