2023-03-04 15:56:35 +08: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 18:08:50 +08:00
|
|
|
To record only the audio:
|
|
|
|
|
|
|
|
```bash
|
2023-05-07 19:04:11 +08:00
|
|
|
scrcpy --no-video --record=file.opus
|
2023-06-05 00:40:55 +08:00
|
|
|
scrcpy --no-video --audio-codec=aac --record=file.aac
|
2023-05-07 19:04:11 +08:00
|
|
|
# .m4a/.mp4 and .mka/.mkv are also supported for both opus and aac
|
2023-05-07 18:08:50 +08:00
|
|
|
```
|
2023-03-04 15:56:35 +08: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-02 00:44:53 +08:00
|
|
|
|
|
|
|
## Format
|
|
|
|
|
2023-03-04 15:56:35 +08:00
|
|
|
The video and audio streams are encoded on the device, but are muxed on the
|
|
|
|
client side. Two formats (containers) are supported:
|
|
|
|
- Matroska (`.mkv`)
|
|
|
|
- MP4 (`.mp4`)
|
|
|
|
|
|
|
|
The container is automatically selected based on the filename.
|
|
|
|
|
|
|
|
It is also possible to explicitly select a container (in that case the filename
|
|
|
|
needs not end with `.mkv` or `.mp4`):
|
|
|
|
|
|
|
|
```
|
|
|
|
scrcpy --record=file --record-format=mkv
|
|
|
|
```
|
2023-06-02 00:44:53 +08:00
|
|
|
|
|
|
|
|
|
|
|
## No playback
|
|
|
|
|
|
|
|
To disable playback while recording:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
scrcpy --no-playback --record=file.mp4
|
|
|
|
scrcpy -Nr file.mkv
|
|
|
|
# interrupt recording with Ctrl+C
|
|
|
|
```
|
|
|
|
|
|
|
|
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-02 00:46:50 +08: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
|
|
|
|
```
|