Skip to content

Commit

Permalink
Update documentation about video orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
rom1v committed Nov 23, 2023
1 parent b43a9e8 commit 94031df
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 17 deletions.
10 changes: 10 additions & 0 deletions doc/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ scrcpy --video-source=camera --camera-size=1920x1080 -m3000 # error
```


## Rotation

To rotate the captured video, use the [video orientation](video.md#orientation)
option:

```
scrcpy --video-source=camera --camera-size=1920x1080 --orientation=90
```


## Frame rate

By default, camera is captured at Android's default frame rate (30 fps).
Expand Down
6 changes: 6 additions & 0 deletions doc/recording.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ scrcpy --record=file --record-format=mkv
```


## Rotation

The video can be recorded rotated. See [video
orientation](video.md#orientation).


## No playback

To disable playback while recording:
Expand Down
45 changes: 28 additions & 17 deletions doc/video.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,39 +97,50 @@ scrcpy --video-codec=h264 --video-encoder='OMX.qcom.video.encoder.avc'
```


## Rotation
## Orientation

The rotation may be applied at 3 different levels:
The orientation may be applied at 3 different levels:
- The [shortcut](shortcuts.md) <kbd>MOD</kbd>+<kbd>r</kbd> requests the
device to switch between portrait and landscape (the current running app may
refuse, if it does not support the requested orientation).
- `--lock-video-orientation` changes the mirroring orientation (the orientation
of the video sent from the device to the computer). This affects the
recording.
- `--rotation` rotates only the window content. This only affects the display,
not the recording. It may be changed dynamically at any time using the
[shortcuts](shortcuts.md) <kbd>MOD</kbd>+<kbd>←</kbd> and
<kbd>MOD</kbd>+<kbd>→</kbd>.
- `--orientation` is applied on the client side, and affects display and
recording. For the display, it can be changed dynamically using
[shortcuts](shortcuts.md).

To lock the mirroring orientation:
To lock the mirroring orientation (on the capture side):

```bash
scrcpy --lock-video-orientation # initial (current) orientation
scrcpy --lock-video-orientation=0 # natural orientation
scrcpy --lock-video-orientation=1 # 90° counterclockwise
scrcpy --lock-video-orientation=2 # 180°
scrcpy --lock-video-orientation=3 # 90° clockwise
scrcpy --lock-video-orientation # initial (current) orientation
scrcpy --lock-video-orientation=0 # natural orientation
scrcpy --lock-video-orientation=90 # 90° clockwise
scrcpy --lock-video-orientation=180 # 180°
scrcpy --lock-video-orientation=270 # 270° clockwise
```

To set an initial window rotation:
To orient the video (on the rendering side):

```bash
scrcpy --rotation=0 # no rotation
scrcpy --rotation=1 # 90 degrees counterclockwise
scrcpy --rotation=2 # 180 degrees
scrcpy --rotation=3 # 90 degrees clockwise
scrcpy --orientation=0
scrcpy --orientation=90 # 90° clockwise
scrcpy --orientation=180 # 180°
scrcpy --orientation=270 # 270° clockwise
scrcpy --orientation=flip0 # hflip
scrcpy --orientation=flip90 # hflip + 90° clockwise
scrcpy --orientation=flip180 # vflip (hflip + 180°)
scrcpy --orientation=flip270 # hflip + 270° clockwise
```

The orientation can be set separately for display and record if necessary, via
`--display-orientation` and `--record-orientation`.

The rotation is applied to a recorded file by writing a display transformation
to the MP4 or MKV target file. Flipping is not supported, so only the 4 first
values are allowed when recording.


## Crop

The device screen may be cropped to mirror only part of the screen.
Expand Down

0 comments on commit 94031df

Please sign in to comment.