Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrcpy/doc/recording.md at master · Genymobile/scrcpy #977

Open
1 task
ShellLM opened this issue Jan 25, 2025 · 1 comment
Open
1 task

scrcpy/doc/recording.md at master · Genymobile/scrcpy #977

ShellLM opened this issue Jan 25, 2025 · 1 comment
Labels
Automation Automate the things CLI-UX Command Line Interface user experience and best practices DigitalWellbeing Notes on living well in the digital era. Git-Repo Source code repository like gitlab or gh Software2.0 Software development driven by AI and neural networks. source-code Code snippets TIL Short notes or tips on coding, linux, llms, ml, etc

Comments

@ShellLM
Copy link
Collaborator

ShellLM commented Jan 25, 2025

Recording

To record video and audio streams while mirroring:

scrcpy --record=file.mp4
scrcpy -r file.mkv

To record only the video:

scrcpy --no-audio --record=file.mp4

To record only the audio:

scrcpy --no-video --record=file.opus
scrcpy --no-video --audio-codec=aac --record=file.aac
scrcpy --no-video --audio-codec=flac --record=file.flac
scrcpy --no-video --audio-codec=raw --record=file.wav

Note: .m4a/.mp4 and .mka/.mkv are also supported for opus, aac and flac.

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).

Format

The video and audio streams are encoded on the device, but are muxed on the client side. Several formats (containers) are supported:

  • MP4 (.mp4, .m4a, .aac)
  • Matroska (.mkv, .mka)
  • OPUS (.opus)
  • FLAC (.flac)
  • WAV (.wav)

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 a known extension):

scrcpy --record=file --record-format=mkv

Rotation

The video can be recorded rotated. See video orientation.

No Playback

To disable playback and control while recording:

scrcpy --no-playback --no-control --record=file.mp4

It is also possible to disable video and audio playback separately:

# Record both video and audio, but only play video
scrcpy --record=file.mkv --no-audio-playback

To also disable the window:

scrcpy --no-playback --no-window --record=file.mp4
# interrupt recording with Ctrl+C

Time Limit

To limit the recording time:

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

Suggested labels

None

@ShellLM ShellLM added Git-Repo Source code repository like gitlab or gh github gh tools like cli, Actions, Issues, Pages source-code Code snippets labels Jan 25, 2025
@ShellLM
Copy link
Collaborator Author

ShellLM commented Jan 25, 2025

Related content

#64 similarity score: 0.83

@irthomasthomas irthomasthomas added TIL Short notes or tips on coding, linux, llms, ml, etc Automation Automate the things DigitalWellbeing Notes on living well in the digital era. CLI-UX Command Line Interface user experience and best practices Software2.0 Software development driven by AI and neural networks. and removed github gh tools like cli, Actions, Issues, Pages labels Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Automation Automate the things CLI-UX Command Line Interface user experience and best practices DigitalWellbeing Notes on living well in the digital era. Git-Repo Source code repository like gitlab or gh Software2.0 Software development driven by AI and neural networks. source-code Code snippets TIL Short notes or tips on coding, linux, llms, ml, etc
Projects
None yet
Development

No branches or pull requests

2 participants