recording

i use the huffyuv codec to record my screen on the rare occasion i want the recording to be lossless.

both these commands run from the terminal. to stop recording, go back to the terminal and press ctrl+c. the resulting file size will be REALLY big (like, 500mb/10 sec big) but will be lossless.

x11

on x11, can use ffmpeg with x11grab. the number after -r is the fps, can change it to something else like 60, 24, etc.

ffmpeg -f x11grab -r 30 -s 1920x1080 -i $DISPLAY -vcodec huffyuv out.mkv

wayland

on wayland, use wf-recorder

wf-recorder --codec=huffyuv -p context=0 -f output.mkv

trimming and cropping

i use Avidemux to crop and trim videos. if it’s not in your distro’s repository, can also use the flatpak.

open the program and import the video. there’s a timeline on the bottom where you can trim the video (the start and end point buttons are A and B respectively around the red x button).

in order to crop the video, click on the drop down menu right under “Video Output” on the left hand side (should default to “copy”). there are a number of different encoders. i use “HEVC (x265)”. go back and click on “Configuration”. under “Rate Control” set the quality to 0 for high quality. the configuration settings depend on the encoder so if you can’t use HEVC (x265) you might need to play around with the settings in order to find something that looks good to you. next click on “Filters” and then under “Transformation” click on “Crop”. you can drag the handles to crop the video, then click on “Okay” on the bottom right. there are a number of other filters you can play with; when you’re done you can preview how the final video will look like before closing. to export the video press ctrl+s or “File > Save” on the upper left.

while not actually lossless i find that using these settings in avidemux gives very good quality compared to other methods when screen recording things like web pages, games with pixel graphics, and other stuff with large sections of one color where the noise introduced by my usual screen capture methods is extremely noticeable. avidemux also supports encoding with huffyuv but the resulting file size will still be very large.