1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226
|
.Dd $Mdocdate: July 30 2022 $
.Dt WF-RECORDER 1
.Os
.Sh NAME
.Nm wf-recorder
.Nd simple screen recording program for wlroots-based compositors
.Sh SYNOPSIS
.Nm wf-recorder
.Op Fl abcCdDefFghlmopPrRvxX
.Op Fl a, -audio Op Ar =DEVICE
.Op Fl b, -bframes Ar max_b_frames
.Op Fl B, -buffrate Ar buffrate
.Op Fl c, -codec Ar output_codec
.Op Fl r, -framerate Ar framerate
.Op Fl d, -device Ar encoding_device
.Op Fl -no-dmabuf
.Op Fl D, -no-damage
.Op Fl f Ar filename.ext
.Op Fl F Ar filter_string
.Op Fl g, -geometry Ar geometry
.Op Fl h, -help
.Op Fl l, -log
.Op Fl m, -muxer Ar muxer
.Op Fl o, -output Ar output
.Op Fl p, -codec-param Op Ar option_param=option_value
.Op Fl v, -version
.Op Fl x, -pixel-format
.Op Fl -audio-backend Ar audio_backend
.Op Fl C, -audio-codec Ar output_audio_codec
.Op Fl P, -audio-codec-param Op Ar option_param=option_value
.Op Fl R, -sample-rate Ar sample_rate
.Op Fl X, -sample-format Ar sample_format
.Op Fl y, -overwrite
.Sh DESCRIPTION
.Nm
is a tool built to record your screen on Wayland compositors.
It makes use of
.Sy wlr-screencopy
for capturing video and
.Xr ffmpeg 1
for encoding it.
.Pp
In its simplest form, run
.Nm
to start recording and use
.Ql Ctrl+C
to stop.
This will create a file called
.Ql recording.mp4
in the current working directory using the default
.Ar codec.
.Pp
The options are as follows:
.Pp
.Bl -tag -width Ds -compact
.It Fl a , -audio Op Ar =DEVICE
Starts recording the screen with audio.
.Pp
.Ar DEVICE
argument is optional.
In case you want to specify the PulseAudio device which will capture the audio,
you can run this command with the name of that device.
You can find your device by running
.D1 $ pactl list sources | grep Name
.Pp
.It Fl b , -bframes Ar max_b_frames
Sets the maximum number of B-Frames to use.
.It Fl B , -buffrate Ar buffrate
Tells the encoder a prediction of what framerate to expect.
This preserves VFR and Solves FPS limit issue of some encoders (like svt-av1).
Should be set to the same framerate as display.
.Pp
.It Fl c , -codec Ar output_codec
Specifies the codec of the video. Supports GIF output as well.
.Pp
To modify codec parameters, use
.Fl p Ar option_name=option_value
.Pp
.It Fl r , -framerate Ar framerate
Sets hard constant framerate. Will duplicate frames to reach it.
This makes the resulting video CFR. Solves FPS limit issue of some encoders.
.Pp
.It Fl d , -device Ar encoding_device
Selects the device to use when encoding the video.
.Pp
Some drivers report support for
.Ql rgb0
data for vaapi input but really only support yuv.
Use the
.Fl x Ar yuv420
option in addition to the vaapi options to convert the
data in software, before sending it to the GPU.
.Pp
.It Fl -no-dmabuf
By default, wf-recorder will try to use only GPU buffers and copies if using a GPU encoder.
However, this can cause issues on some systems.
In such cases, this option will disable the GPU copy and force a CPU one.
.Pp
.It Fl D , -no-damage
By default, wf-recorder will request a new frame from the compositor
only when the screen updates. This results in a much smaller output
file, which however has a variable refresh rate. When this option is
on, wf-recorder does not use this optimization and continuously
records new frames, even if there are no updates on the screen.
.Pp
.It Fl f Ar filename.ext
By using the
.Fl f
option, the output file will have the name
.Ar filename.ext
and the file format will be determined by the provided extension.
If the extension is not recognized by your
.Xr ffmpeg 1
muxers, the command will fail.
.Pp
You can check the muxers that your
.Xr ffmpeg 1
installation supports by running
.Dl $ ffmpeg -muxers
.Pp
.It Fl F , -filter Ar filter_string
Set the ffmpeg filter to use. VAAPI requires `scale_vaapi=format=nv12:out_range=full` to work.
.Pp
.It Fl g , -geometry Ar screen_geometry
Selects a specific part of the screen. The format is "x,y WxH".
.Pp
.It Fl h , -help
Prints the help screen.
.Pp
.It Fl l , -log
Generates a log on the current terminal. For debug purposes.
.Pp
.It Fl m , -muxer Ar muxer
Set the output format to a specific muxer instead of detecting it from the filename.
.Pp
.It Fl o , -output
Specify the output where the video is to be recorded.
.Pp
.It Fl p , -codec-param Op Ar option_name=option_value
Change the codec parameters.
.Pp
.It Fl v , -version
Print the version of wf-recorder.
.Pp
.It Fl x , -pixel-format Ar pixel_format
Set the output pixel format.
.Pp
List available formats using
.Dl $ ffmpeg -pix_fmts
.Pp
.It Fl -audio-backend Ar audio_backend
Specifies the audio backend to be used when -a is set.
.Pp
.It Fl C , -audio-codec Ar output_audio_codec
Specifies the codec of the audio.
.Pp
.It Fl P , -audio-codec-param Op Ar option_name=option_value
Change the audio codec parameters.
.Pp
.It Fl R , -sample-rate Ar sample_rate
Changes the audio sample rate, in HZ. The default value is 48000.
.Pp
.It Fl X , -sample-format Ar sample_format
Set the output audio sample format.
.Pp
List available formats using
.Dl $ ffmpeg -sample_fmts
.Pp
.It Fl y , -overwrite
Force overwriting the output file without prompting.
.El
.Sh EXAMPLES
To select a specific part of the screen you can either use
.Fl -g Ar geometry
or
use https://github.com/emersion/slurp for interactive selection of the
screen area that will be recorded:
.Dl $ wf-recorder -g "$(slurp)"
.Pp
You can record screen and sound simultaneously with
.Dl $ wf-recorder --audio --file=recording_with_audio.mp4
.Pp
To specify an audio device, use the
.Fl -a<DEVICE>
or
.Fl --audio=<DEVICE>
options.
.Pp
To specify a
.Ar codec
use the
.Fl c Ar codec
option. To modify codec parameters,
.Fl p
.Ar option_name=option_value.
.Pp
To set a specific output format, use the
.Fl m, -muxer
option. For example, to
output to a
.Sy video4linux2
loopback you might use:
.Dl $ wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2
.Pp
To use GPU encoding, use a VAAPI codec (for ex.
.Ql h264_vaapi
) and specify a GPU
device to use with the
.Fl d
option:
.Dl $ wf-recorder -f test-vaapi.mkv -c h264_vaapi -d /dev/dri/renderD128
.Pp
Some drivers report support for
.Ql rgb0
data for
.Ql vaapi
input but really only support yuv planar formats.
In this case, use the
.Fl x Ar yuv420p
option in addition to the
.Ql vaapi
options to convert the data to yuv planar data before sending it to the GPU.
.Sh SEE ALSO
.Xr ffmpeg 1 ,
.Xr pactl 1
|