2023-03-04 07:56:35 +00:00
|
|
|
# Recording
|
|
|
|
|
|
|
|
To record video and audio streams while mirroring:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --record=file.mp4
|
|
|
|
scrcpy -r file.mkv
|
|
|
|
```
|
|
|
|
|
|
|
|
To record only the video:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-audio --record=file.mp4
|
|
|
|
```
|
|
|
|
|
2023-05-07 10:08:50 +00:00
|
|
|
To record only the audio:
|
|
|
|
|
|
|
|
```bash
|
2023-05-07 11:04:11 +00:00
|
|
|
scrcpy --no-video --record=file.opus
|
2023-06-04 16:40:55 +00:00
|
|
|
scrcpy --no-video --audio-codec=aac --record=file.aac
|
2023-11-07 12:09:47 +00:00
|
|
|
scrcpy --no-video --audio-codec=flac --record=file.flac
|
2023-11-13 08:35:18 +00:00
|
|
|
scrcpy --no-video --audio-codec=raw --record=file.wav
|
2023-11-07 12:09:47 +00:00
|
|
|
# .m4a/.mp4 and .mka/.mkv are also supported for opus, aac and flac
|
2023-05-07 10:08:50 +00:00
|
|
|
```
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
Timestamps are captured on the device, so [packet delay variation] does not
|
|
|
|
impact the recorded file, which is always clean (only if you use `--record` of
|
|
|
|
course, not if you capture your scrcpy window and audio output on the computer).
|
|
|
|
|
|
|
|
[packet delay variation]: https://en.wikipedia.org/wiki/Packet_delay_variation
|
|
|
|
|
2023-06-01 16:44:53 +00:00
|
|
|
|
|
|
|
## Format
|
|
|
|
|
2023-03-04 07:56:35 +00:00
|
|
|
The video and audio streams are encoded on the device, but are muxed on the
|
2023-11-14 08:08:24 +00:00
|
|
|
client side. Several formats (containers) are supported:
|
|
|
|
- MP4 (`.mp4`, `.m4a`, `.aac`)
|
|
|
|
- Matroska (`.mkv`, `.mka`)
|
|
|
|
- OPUS (`.opus`)
|
2023-11-07 12:09:47 +00:00
|
|
|
- FLAC (`.flac`)
|
2023-11-13 08:35:18 +00:00
|
|
|
- WAV (`.wav`)
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
The container is automatically selected based on the filename.
|
|
|
|
|
|
|
|
It is also possible to explicitly select a container (in that case the filename
|
2023-11-14 08:08:24 +00:00
|
|
|
needs not end with a known extension):
|
2023-03-04 07:56:35 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
scrcpy --record=file --record-format=mkv
|
|
|
|
```
|
2023-06-01 16:44:53 +00:00
|
|
|
|
|
|
|
|
2023-11-20 19:56:36 +00:00
|
|
|
## Rotation
|
|
|
|
|
|
|
|
The video can be recorded rotated. See [video
|
|
|
|
orientation](video.md#orientation).
|
|
|
|
|
|
|
|
|
2023-06-01 16:44:53 +00:00
|
|
|
## No playback
|
|
|
|
|
2024-04-20 16:12:20 +00:00
|
|
|
To disable playback and control while recording:
|
2023-06-01 16:44:53 +00:00
|
|
|
|
|
|
|
```bash
|
2024-04-20 16:12:20 +00:00
|
|
|
scrcpy --no-playback --no-control --record=file.mp4
|
2023-06-01 16:44:53 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
It is also possible to disable video and audio playback separately:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Record both video and audio, but only play video
|
|
|
|
scrcpy --record=file.mkv --no-audio-playback
|
|
|
|
```
|
2023-06-01 16:46:50 +00:00
|
|
|
|
2024-04-20 16:12:20 +00:00
|
|
|
To also disable the window:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-playback --no-window --record=file.mp4
|
|
|
|
# interrupt recording with Ctrl+C
|
|
|
|
```
|
|
|
|
|
2023-06-01 16:46:50 +00:00
|
|
|
## Time limit
|
|
|
|
|
|
|
|
To limit the recording time:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --record=file.mkv --time-limit=20 # in seconds
|
|
|
|
```
|
|
|
|
|
|
|
|
The `--time-limit` option is not limited to recording, it also impacts simple
|
|
|
|
mirroring:
|
|
|
|
|
|
|
|
```
|
|
|
|
scrcpy --time-limit=20
|
|
|
|
```
|