Wayland screen: record, rotate, crop

2024-12-27

Time to time I need to record screen; no more need to search for how to do it:

wf-recorder -f raw.mkv

I have two monitors, 1920x1200, 90 degrees rotated. When recording, I need to select which one to record.

Then, I need to process raw.mkv – it’s uncomfortable to look at video like at emoticons :-) and I usually need just part of the video (both time and spatial.)

ffmpeg -i raw.mkv \
    -ss 00:01:59 -to 00:02:13 \
    -vf "transpose=1,crop=1200:600:0:22" \
    out.mkv

The order of -i, -ss, -to, -vf matters. transpose=1 makes video πŸ™‚ and crop=1200:600:0:22 outputs video of 1200 width, 600 height, 0 x offset (from left) and 22 y offset (from top, where sway-bar is.)

In crop filter, iw and ih correspond to input video width and height and can be used as variables.

man ffmpeg-filters
go back