CasTTY is a script for lecture recording and postprocessing. It was written in the duress of 2020. When it breaks, you get to keep both pieces.
CasTTY includes commands to:
- Record individual slides, or parts of slides.
- Postprocess recorded files, including:
- Transcoding,
- Applying video overlays on a background slide,
- Concatenating slides/parts,
- And audio filtering.
Commands are run from the Common Lisp REPL, so it helps to have multiple monitors. Most of the real work is done by FFmpeg.
CasTTY operates relative to a working directory:
(setq castty:*workdir* "/PATH/TO/STORE/MY/VIDEO/FILES")
Record screen and audio quickly with minimal / fast compression.
-
To record audio and video for a slide:
(castty:record :number '(SLIDE-NUMBER SLIDE-PART) :video t :audio t)
-
To record audio and take a screenshot:
(castty:record :number '(SLIDE-NUMBER SLIDE-PART) :video :screenshot :audio t)
-
To take a screenshot and not record audio:
(castty:record :number '(SLIDE-NUMBER SLIDE-PART) :video :screenshot :audio nil)
-
To record audio and no video or screenshot:
(castty:record :number '(SLIDE-NUMBER SLIDE-PART) :video nil :audio t)
To end the recording run the casttykill
script; it helps configure a
key binding in your window manager to call this script.
CasTTY can overlay a separate video (and audio) on a captured slide.
-
Take a screenshot for the overlay background:
(castty:record :number '(SLIDE-NUMBER SLIDE-PART) :video :background :audio nil)
-
Copy the video overlay into the
./src
directory.
The overlay will be constructed during postprocessing.
Postprocessing involves transcoding, overlay construction, concatenation, and audio filtering. The following command will postprocess the recordings:
(castty:post)
You can also postprocess from the shell with the following command, in which case the current directory will be the working directory.
$ castty post
Remove all temporary and output files in the working directory:
(castty:clean)
You can also clean from the shell with the following command, in which case the current directory will be the working directory.
$ castty clean
You can transcode files from the shell with:
$ CASTTY_INPUT=file.mp4 castty transcode
If you want to modify options, you can override the default scene or specific parameters:
$ CASTTY_PARAM_AUDIO_FILTER="highpass=f=100,lowpass=f=10000" \
CASTTY_INPUT=file.mp4 castty transcode
$HOME/.config/castty/scene-alist.lisp
: configuration file to set recording and output options. See the./lisp/scene-alist.lisp
in the source tree for an example.
Directories are relative to the working directory set in
castty:*workdir*
.
./rec/
: Directory containing initial recordings./src/
: Directory containing (lossless) transcoded recordings./out/
: Directory containing output files./tmp/
: Directory for Temporary working files
/var/run/user/$UID/castty.pid
: PIDs of currently running recording processes. Thecasttykill
script stops a recording by killing each of these processes.
./out/hi-quality.mkv
: high-quality video file./out/compressed.mp4
: compressed video file
CASTTY_SCENE
: The scene to use when calling from the shellCASTTY_PARAM_FOO
: Override scene parameter FOOCASTTY_INPUT
: Input file