Skip to content

Commit

Permalink
docs: fix help and examples regarding -a & --audio (ammen99#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
llyyr authored Jul 30, 2022
1 parent 387e576 commit 761eb52
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 18 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,25 @@ You can record screen and sound simultaneously with
wf-recorder --audio --file=recording_with_audio.mp4
```

To specify an audio device, use the `-a<device>` or `--audio=<device>` options.

To specify a video codec, use the `-c <codec>` option. To modify codec parameters, use `-p <option_name>=<option_value>`.

You can also specify an audio codec, using `-C <codec>`. Alternatively, the long form `--audio-codec` can be used.

You can use the following command to check all available video codecs
```
ffmpeg -hide_banner -encoders | grep -E '^ V' | grep -F '(codec' | cut -c 8- | sort
```

and the following for audio codecs

```
ffmpeg -hide_banner -encoders | grep -E '^ A' | grep -F '(codec' | cut -c 8- | sort
```

Use ffmpeg to get details about specific encoder, filter or muxer.

To set a specific output format, use the `--muxer` option. For example, to output to a video4linux2 loopback you might use:
```
wf-recorder --muxer=v4l2 --codec=rawvideo --file=/dev/video2
Expand Down
14 changes: 10 additions & 4 deletions manpage/wf-recorder.1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
.Dd $Mdocdate: July 07 2022 $
.Dd $Mdocdate: July 26 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 abcdDefghlmoptvx
.Op Fl a , -audio Op Ar DEVICE
.Op Fl abcCdDefFghlmopPrRtvxX
.Op Fl a, -audio Op Ar =DEVICE
.Op Fl b, -bframes Ar max_b_frames
.Op Fl c, -codec Ar output_codec
.Op Fl r, -framerate Ar framerate
Expand Down Expand Up @@ -50,7 +50,7 @@ in the current working directory using the default
The options are as follows:
.Pp
.Bl -tag -width Ds -compact
.It Fl a , -audio Op Ar DEVICE
.It Fl a , -audio Op Ar =DEVICE
Starts recording the screen with audio.
.Pp
.Ar DEVICE
Expand Down Expand Up @@ -170,6 +170,12 @@ screen area that will be recorded:
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
Expand Down
32 changes: 18 additions & 14 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -548,15 +548,17 @@ Use Ctrl+C to stop.)");
#ifdef HAVE_PULSE
printf(R"(
-a, --audio [DEVICE] Starts recording the screen with audio.
[DEVICE] argument is optional.
-a, --audio[=DEVICE] Starts recording the screen with audio.
[=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: pactl list sources | grep Name)");
You can find your device by running: pactl list sources | grep Name
Specify device like this: -a<device> or --audio=<device>)");
#endif
printf(R"(
-c, --codec Specifies the codec of the video. Supports GIF output also.
-c, --codec Specifies the codec of the video. These can be found by using:
ffmpeg -encoders
To modify codec parameters, use -p <option_name>=<option_value>
-r, --framerate Changes an approximation of the video framerate. The default is 60.
Expand All @@ -576,13 +578,13 @@ Use Ctrl+C to stop.)");
while extension .ext . If the extension .ext provided is not
recognized by your FFmpeg muxers, the command will fail.
You can check the muxers that your FFmpeg installation supports by
running : ffmpeg -muxers
running: ffmpeg -muxers
-m, --muxer Set the output format to a specific muxer instead of detecting it
from the filename.
-x, --pixel-format Set the output pixel format. These can be found by running:
*ffmpeg -pix_fmts*
ffmpeg -pix_fmts
-g, --geometry Selects a specific part of the screen. The format is "x,y WxH".
Expand All @@ -606,15 +608,17 @@ Use Ctrl+C to stop.)");
-b, --bframes This option is used to set the maximum number of b-frames to be used.
If b-frames are not supported by your hardware, set this to 0.
-C, --audio-codec Specifies the codec of the audio.
-C, --audio-codec Specifies the codec of the audio. These can be found by running:
ffmpeg -encoders
To modify codec parameters, use -P <option_name>=<option_value>
-X, --sample-format Set the output audio sample format. These can be found by running:
*ffmpeg -sample_fmts*
ffmpeg -sample_fmts
-R, --sample-rate Changes the audio sample rate, in HZ. The default value is 48000.
-R, --sample-rate Changes the audio sample rate in HZ. The default value is 48000.
-P, --audio-codec-param Change the audio codec parameters.
-P <option_name>=<option_value>)
-P <option_name>=<option_value>
Examples:)");
#ifdef HAVE_PULSE
Expand All @@ -629,19 +633,19 @@ Examples:)");
current working directory.
- wf-recorder -f <filename>.ext Records the video. Use Ctrl+C to stop recording.
The video file will be stored as <outputname>.ext in the
The video file will be stored as <filename>.ext in the
current working directory.)");
#ifdef HAVE_PULSE
printf(R"(
Video and Audio:
- wf-recorder -a Records the audio. Use Ctrl+C to stop recording.
- wf-recorder -a Records the video and audio. Use Ctrl+C to stop recording.
The video file will be stored as recording.mp4 in the
current working directory.
- wf-recorder -a -f <filename>.ext Records the audio. Use Ctrl+C to stop recording.
The video file will be stored as <outputname>.ext in the
- wf-recorder -a -f <filename>.ext Records the video and audio. Use Ctrl+C to stop recording.
The video file will be stored as <filename>.ext in the
current working directory.)");
#endif
printf(R"(
Expand Down

0 comments on commit 761eb52

Please sign in to comment.