diff options
author | Mattias Andrée <maandree@kth.se> | 2024-06-16 15:16:29 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2024-06-16 15:16:29 +0200 |
commit | 6a759b1e341c96ab7f7389db1600f2f764c6a9c5 (patch) | |
tree | 99517ccd3e5fd22bbf9b8457f0b8b31185c571a2 /ffmpeg/resize-and-transcode | |
parent | Minor fixes (diff) | |
parent | Fix printf usage (diff) | |
download | dotfiles-6a759b1e341c96ab7f7389db1600f2f764c6a9c5.tar.gz dotfiles-6a759b1e341c96ab7f7389db1600f2f764c6a9c5.tar.bz2 dotfiles-6a759b1e341c96ab7f7389db1600f2f764c6a9c5.tar.xz |
Merge branch 'master' of ssh://maandree.se/gitrepos/~maandree/dotfiles
Diffstat (limited to '')
-rwxr-xr-x | ffmpeg/resize-and-transcode | 4 | ||||
-rwxr-xr-x | ffmpeg/resize-and-transcode-recursively | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/ffmpeg/resize-and-transcode b/ffmpeg/resize-and-transcode index f3fe017..2b7b962 100755 --- a/ffmpeg/resize-and-transcode +++ b/ffmpeg/resize-and-transcode @@ -13,7 +13,7 @@ err () { colour="$1" format="$2" shift 2 - printf '\x1b['"${colour}m${format}"'\x1b[m\n' "$@" >&2 + printf '\033['"${colour}m${format}"'\033[m\n' "$@" >&2 } alert () { err "1;31" "$@"; } @@ -99,8 +99,10 @@ if test -z "$scale" && test "$codec" = '-c:v copy'; then exit 1 fi +ttysetting="$(stty -g)" ffmpeg -i "$input" $scale $codec -c:a copy -- "$output" ret=$? +stty -- "$ttysetting" if test $ret = 0; then oldsize=$(stat -c '%s' -- "$input") diff --git a/ffmpeg/resize-and-transcode-recursively b/ffmpeg/resize-and-transcode-recursively index 8a7a207..c420de3 100755 --- a/ffmpeg/resize-and-transcode-recursively +++ b/ffmpeg/resize-and-transcode-recursively @@ -12,7 +12,7 @@ err () { colour="$1" format="$2" shift 2 - printf '\x1b['"${colour}m${format}"'\x1b[m\n' "$@" >&2 + printf '\033['"${colour}m${format}"'\033[m\n' "$@" >&2 } alert () { err "1;31" "$@"; } |