#! /bin/zsh # # this file: # https://dataswamp.org/~incal/conf/.zsh/movie gif2mp4 () { ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4 } emacs-audio-rec () { local name=$1 rec ${name}.wav &> /dev/null & local pid=$! ttyrec -e emacs $name kill -9 $pid 2> /dev/null } emacs-rec () { local name=$1 ttyrec -e emacs $name } ttttrec () { local name=$1 ttyrec $name ttyrec2video ttyrecord } # $ sudo apt-get install libsox-fmt-mp3 tty-mp3-play () { local name=$1 play ${name}.mp3 &> /dev/null & ttyplay $name } ttylen () { local file=$1 local sec=$(ttytime $file | awk '{print $2}') units "$sec s" hms }