This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
setopt ERR_EXIT | |
if [[ -z $1 ]] | |
then | |
cat <<EOF | |
Usage: $0 /path/to/test-image.png | |
Warning: run script from empty directory, otherwise it may delete your files (e.g. q*.png). | |
EOF | |
false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
f="${1-$$.mkv}" | |
rate=25 | |
echo "Click a window to record.." | |
coords=( $(xwininfo | awk '/Absolute upper-left [XY]:/ {print $4} /Width:|Height:/ {print $2}') ) | |
#aopts=(-f alsa -i live) | |
#aopts=(-f pulse -i default) | |
aopts=() | |
ffmpeg -s $((coords[3]/2*2))x$((coords[4]/2*2)) -r $rate -f x11grab -show_region 1 -i ${DISPLAY}+${coords[1]},${coords[2]} $aopts -c:v libx264 -pix_fmt yuv420p -qp 0 -tune zerolatency -preset ultrafast -y $f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env zsh | |
# exit on errors | |
set -e | |
tempdir="/tmp" | |
if [[ -n $1 ]] | |
then | |
audio_file=$1 | |
track_length="$(ffprobe $1 2>&1|sed -n 's/.*Duration: \([^,]\+\),.*/\1/p')" | |
elif pgrep mocp > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
usage: place script into $HOME/.mpv/lua/ directory (mpv 0.4 and later) | |
or run mpv --lua path/to/capture.lua | |
or add "lua=/absolute/path/to/capture.lua" to ~/.mpv/config | |
keybindings: | |
a - capture fragment: at first press script remembers start position, at second outputs command for encoding | |
c - crop: first press remembers mouse cursor coords, second outputs crop filter parameters. | |
]] | |
capture = {} | |
local gp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
############################################################################ | |
# This program is free software: you can redistribute it and/or modify # | |
# it under the terms of the GNU General Public License as published by # | |
# the Free Software Foundation, either version 3 of the License, or # | |
# (at your option) any later version. # | |
# # | |
# This program is distributed in the hope that it will be useful, # | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # |