Compare commits
1 Commits
broken_opt
...
video_buff
Author | SHA1 | Date | |
---|---|---|---|
c29ecd0314 |
@ -20,7 +20,6 @@ _scrcpy() {
|
|||||||
--crop=
|
--crop=
|
||||||
-d --select-usb
|
-d --select-usb
|
||||||
--disable-screensaver
|
--disable-screensaver
|
||||||
--display-buffer=
|
|
||||||
--display-id=
|
--display-id=
|
||||||
--display-orientation=
|
--display-orientation=
|
||||||
-e --select-tcpip
|
-e --select-tcpip
|
||||||
@ -90,6 +89,7 @@ _scrcpy() {
|
|||||||
--v4l2-sink=
|
--v4l2-sink=
|
||||||
-v --version
|
-v --version
|
||||||
-V --verbosity=
|
-V --verbosity=
|
||||||
|
--video-buffer=
|
||||||
--video-codec=
|
--video-codec=
|
||||||
--video-codec-options=
|
--video-codec-options=
|
||||||
--video-encoder=
|
--video-encoder=
|
||||||
@ -191,7 +191,6 @@ _scrcpy() {
|
|||||||
|--camera-size \
|
|--camera-size \
|
||||||
|--crop \
|
|--crop \
|
||||||
|--display-id \
|
|--display-id \
|
||||||
|--display-buffer \
|
|
||||||
|--max-fps \
|
|--max-fps \
|
||||||
|-m|--max-size \
|
|-m|--max-size \
|
||||||
|-p|--port \
|
|-p|--port \
|
||||||
@ -201,6 +200,7 @@ _scrcpy() {
|
|||||||
|--tunnel-port \
|
|--tunnel-port \
|
||||||
|--v4l2-buffer \
|
|--v4l2-buffer \
|
||||||
|--v4l2-sink \
|
|--v4l2-sink \
|
||||||
|
|--video-buffer \
|
||||||
|--video-codec-options \
|
|--video-codec-options \
|
||||||
|--video-encoder \
|
|--video-encoder \
|
||||||
|--tcpip \
|
|--tcpip \
|
||||||
|
@ -27,7 +27,6 @@ arguments=(
|
|||||||
'--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]'
|
'--crop=[\[width\:height\:x\:y\] Crop the device screen on the server]'
|
||||||
{-d,--select-usb}'[Use USB device]'
|
{-d,--select-usb}'[Use USB device]'
|
||||||
'--disable-screensaver[Disable screensaver while scrcpy is running]'
|
'--disable-screensaver[Disable screensaver while scrcpy is running]'
|
||||||
'--display-buffer=[Add a buffering delay \(in milliseconds\) before displaying]'
|
|
||||||
'--display-id=[Specify the display id to mirror]'
|
'--display-id=[Specify the display id to mirror]'
|
||||||
'--display-orientation=[Set the initial display orientation]:orientation values:(0 90 180 270 flip0 flip90 flip180 flip270)'
|
'--display-orientation=[Set the initial display orientation]:orientation values:(0 90 180 270 flip0 flip90 flip180 flip270)'
|
||||||
{-e,--select-tcpip}'[Use TCP/IP device]'
|
{-e,--select-tcpip}'[Use TCP/IP device]'
|
||||||
@ -92,6 +91,7 @@ arguments=(
|
|||||||
'--v4l2-sink=[\[\/dev\/videoN\] Output to v4l2loopback device]'
|
'--v4l2-sink=[\[\/dev\/videoN\] Output to v4l2loopback device]'
|
||||||
{-v,--version}'[Print the version of scrcpy]'
|
{-v,--version}'[Print the version of scrcpy]'
|
||||||
{-V,--verbosity=}'[Set the log level]:verbosity:(verbose debug info warn error)'
|
{-V,--verbosity=}'[Set the log level]:verbosity:(verbose debug info warn error)'
|
||||||
|
'--video-buffer=[Add a buffering delay \(in milliseconds\) before displaying video frames]'
|
||||||
'--video-codec=[Select the video codec]:codec:(h264 h265 av1)'
|
'--video-codec=[Select the video codec]:codec:(h264 h265 av1)'
|
||||||
'--video-codec-options=[Set a list of comma-separated key\:type=value options for the device video encoder]'
|
'--video-codec-options=[Set a list of comma-separated key\:type=value options for the device video encoder]'
|
||||||
'--video-encoder=[Use a specific MediaCodec video encoder]'
|
'--video-encoder=[Use a specific MediaCodec video encoder]'
|
||||||
|
16
app/scrcpy.1
16
app/scrcpy.1
@ -139,12 +139,6 @@ Also see \fB\-e\fR (\fB\-\-select\-tcpip\fR).
|
|||||||
.BI "\-\-disable\-screensaver"
|
.BI "\-\-disable\-screensaver"
|
||||||
Disable screensaver while scrcpy is running.
|
Disable screensaver while scrcpy is running.
|
||||||
|
|
||||||
.TP
|
|
||||||
.BI "\-\-display\-buffer " ms
|
|
||||||
Add a buffering delay (in milliseconds) before displaying. This increases latency to compensate for jitter.
|
|
||||||
|
|
||||||
Default is 0 (no buffering).
|
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-\-display\-id " id
|
.BI "\-\-display\-id " id
|
||||||
Specify the device display id to mirror.
|
Specify the device display id to mirror.
|
||||||
@ -560,7 +554,15 @@ It requires to lock the video orientation (see \fB\-\-lock\-video\-orientation\f
|
|||||||
.BI "\-\-v4l2-buffer " ms
|
.BI "\-\-v4l2-buffer " ms
|
||||||
Add a buffering delay (in milliseconds) before pushing frames. This increases latency to compensate for jitter.
|
Add a buffering delay (in milliseconds) before pushing frames. This increases latency to compensate for jitter.
|
||||||
|
|
||||||
This option is similar to \fB\-\-display\-buffer\fR, but specific to V4L2 sink.
|
This option is similar to \fB\-\-video\-buffer\fR, but specific to V4L2 sink.
|
||||||
|
|
||||||
|
Default is 0 (no buffering).
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.BI "\-\-video\-buffer " ms
|
||||||
|
Add a buffering delay (in milliseconds) before displaying video frames.
|
||||||
|
|
||||||
|
This increases latency to compensate for jitter.
|
||||||
|
|
||||||
Default is 0 (no buffering).
|
Default is 0 (no buffering).
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ enum {
|
|||||||
OPT_POWER_OFF_ON_CLOSE,
|
OPT_POWER_OFF_ON_CLOSE,
|
||||||
OPT_V4L2_SINK,
|
OPT_V4L2_SINK,
|
||||||
OPT_DISPLAY_BUFFER,
|
OPT_DISPLAY_BUFFER,
|
||||||
|
OPT_VIDEO_BUFFER,
|
||||||
OPT_V4L2_BUFFER,
|
OPT_V4L2_BUFFER,
|
||||||
OPT_TUNNEL_HOST,
|
OPT_TUNNEL_HOST,
|
||||||
OPT_TUNNEL_PORT,
|
OPT_TUNNEL_PORT,
|
||||||
@ -321,12 +322,10 @@ static const struct sc_option options[] = {
|
|||||||
.argdesc = "id",
|
.argdesc = "id",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
// deprecated
|
||||||
.longopt_id = OPT_DISPLAY_BUFFER,
|
.longopt_id = OPT_DISPLAY_BUFFER,
|
||||||
.longopt = "display-buffer",
|
.longopt = "display-buffer",
|
||||||
.argdesc = "ms",
|
.argdesc = "ms",
|
||||||
.text = "Add a buffering delay (in milliseconds) before displaying. "
|
|
||||||
"This increases latency to compensate for jitter.\n"
|
|
||||||
"Default is 0 (no buffering).",
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
.longopt_id = OPT_DISPLAY_ID,
|
.longopt_id = OPT_DISPLAY_ID,
|
||||||
@ -898,11 +897,20 @@ static const struct sc_option options[] = {
|
|||||||
.argdesc = "ms",
|
.argdesc = "ms",
|
||||||
.text = "Add a buffering delay (in milliseconds) before pushing "
|
.text = "Add a buffering delay (in milliseconds) before pushing "
|
||||||
"frames. This increases latency to compensate for jitter.\n"
|
"frames. This increases latency to compensate for jitter.\n"
|
||||||
"This option is similar to --display-buffer, but specific to "
|
"This option is similar to --video-buffer, but specific to "
|
||||||
"V4L2 sink.\n"
|
"V4L2 sink.\n"
|
||||||
"Default is 0 (no buffering).\n"
|
"Default is 0 (no buffering).\n"
|
||||||
"This option is only available on Linux.",
|
"This option is only available on Linux.",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
.longopt_id = OPT_VIDEO_BUFFER,
|
||||||
|
.longopt = "video-buffer",
|
||||||
|
.argdesc = "ms",
|
||||||
|
.text = "Add a buffering delay (in milliseconds) before displaying "
|
||||||
|
"video frames.\n"
|
||||||
|
"This increases latency to compensate for jitter.\n"
|
||||||
|
"Default is 0 (no buffering).",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.longopt_id = OPT_VIDEO_CODEC,
|
.longopt_id = OPT_VIDEO_CODEC,
|
||||||
.longopt = "video-codec",
|
.longopt = "video-codec",
|
||||||
@ -2549,7 +2557,11 @@ parse_args_with_getopt(struct scrcpy_cli_args *args, int argc, char *argv[],
|
|||||||
opts->power_off_on_close = true;
|
opts->power_off_on_close = true;
|
||||||
break;
|
break;
|
||||||
case OPT_DISPLAY_BUFFER:
|
case OPT_DISPLAY_BUFFER:
|
||||||
if (!parse_buffering_time(optarg, &opts->display_buffer)) {
|
LOGW("--display-buffer is deprecated, use --video-buffer "
|
||||||
|
"instead.");
|
||||||
|
// fall through
|
||||||
|
case OPT_VIDEO_BUFFER:
|
||||||
|
if (!parse_buffering_time(optarg, &opts->video_buffer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -58,7 +58,7 @@ const struct scrcpy_options scrcpy_options_default = {
|
|||||||
.window_width = 0,
|
.window_width = 0,
|
||||||
.window_height = 0,
|
.window_height = 0,
|
||||||
.display_id = 0,
|
.display_id = 0,
|
||||||
.display_buffer = 0,
|
.video_buffer = 0,
|
||||||
.audio_buffer = -1, // depends on the audio format,
|
.audio_buffer = -1, // depends on the audio format,
|
||||||
.audio_output_buffer = SC_TICK_FROM_MS(5),
|
.audio_output_buffer = SC_TICK_FROM_MS(5),
|
||||||
.time_limit = 0,
|
.time_limit = 0,
|
||||||
|
@ -261,7 +261,7 @@ struct scrcpy_options {
|
|||||||
uint16_t window_width;
|
uint16_t window_width;
|
||||||
uint16_t window_height;
|
uint16_t window_height;
|
||||||
uint32_t display_id;
|
uint32_t display_id;
|
||||||
sc_tick display_buffer;
|
sc_tick video_buffer;
|
||||||
sc_tick audio_buffer;
|
sc_tick audio_buffer;
|
||||||
sc_tick audio_output_buffer;
|
sc_tick audio_output_buffer;
|
||||||
sc_tick time_limit;
|
sc_tick time_limit;
|
||||||
|
@ -53,7 +53,7 @@ struct scrcpy {
|
|||||||
struct sc_decoder video_decoder;
|
struct sc_decoder video_decoder;
|
||||||
struct sc_decoder audio_decoder;
|
struct sc_decoder audio_decoder;
|
||||||
struct sc_recorder recorder;
|
struct sc_recorder recorder;
|
||||||
struct sc_delay_buffer display_buffer;
|
struct sc_delay_buffer video_buffer;
|
||||||
#ifdef HAVE_V4L2
|
#ifdef HAVE_V4L2
|
||||||
struct sc_v4l2_sink v4l2_sink;
|
struct sc_v4l2_sink v4l2_sink;
|
||||||
struct sc_delay_buffer v4l2_buffer;
|
struct sc_delay_buffer v4l2_buffer;
|
||||||
@ -815,11 +815,11 @@ aoa_complete:
|
|||||||
|
|
||||||
if (options->video_playback) {
|
if (options->video_playback) {
|
||||||
struct sc_frame_source *src = &s->video_decoder.frame_source;
|
struct sc_frame_source *src = &s->video_decoder.frame_source;
|
||||||
if (options->display_buffer) {
|
if (options->video_buffer) {
|
||||||
sc_delay_buffer_init(&s->display_buffer,
|
sc_delay_buffer_init(&s->video_buffer,
|
||||||
options->display_buffer, true);
|
options->video_buffer, true);
|
||||||
sc_frame_source_add_sink(src, &s->display_buffer.frame_sink);
|
sc_frame_source_add_sink(src, &s->video_buffer.frame_sink);
|
||||||
src = &s->display_buffer.frame_source;
|
src = &s->video_buffer.frame_source;
|
||||||
}
|
}
|
||||||
|
|
||||||
sc_frame_source_add_sink(src, &s->screen.frame_sink);
|
sc_frame_source_add_sink(src, &s->screen.frame_sink);
|
||||||
|
@ -170,7 +170,7 @@ latency (for both [video](video.md#buffering) and audio) might be preferable to
|
|||||||
avoid glitches and smooth the playback:
|
avoid glitches and smooth the playback:
|
||||||
|
|
||||||
```
|
```
|
||||||
scrcpy --display-buffer=200 --audio-buffer=200
|
scrcpy --video-buffer=200 --audio-buffer=200
|
||||||
```
|
```
|
||||||
|
|
||||||
It is also possible to configure another audio buffer (the audio output buffer),
|
It is also possible to configure another audio buffer (the audio output buffer),
|
||||||
|
@ -21,9 +21,9 @@ the client and on the server.
|
|||||||
If video is enabled, then the server sends a raw video stream (H.264 by default)
|
If video is enabled, then the server sends a raw video stream (H.264 by default)
|
||||||
of the device screen, with some additional headers for each packet. The client
|
of the device screen, with some additional headers for each packet. The client
|
||||||
decodes the video frames, and displays them as soon as possible, without
|
decodes the video frames, and displays them as soon as possible, without
|
||||||
buffering (unless `--display-buffer=delay` is specified) to minimize latency.
|
buffering (unless `--video-buffer=delay` is specified) to minimize latency. The
|
||||||
The client is not aware of the device rotation (which is handled by the server),
|
client is not aware of the device rotation (which is handled by the server), it
|
||||||
it just knows the dimensions of the video frames it receives.
|
just knows the dimensions of the video frames it receives.
|
||||||
|
|
||||||
Similarly, if audio is enabled, then the server sends a raw audio stream (OPUS
|
Similarly, if audio is enabled, then the server sends a raw audio stream (OPUS
|
||||||
by default) of the device audio output (or the microphone if
|
by default) of the device audio output (or the microphone if
|
||||||
|
@ -189,15 +189,15 @@ The configuration is available independently for the display,
|
|||||||
[v4l2 sinks](video.md#video4linux) and [audio](audio.md#buffering) playback.
|
[v4l2 sinks](video.md#video4linux) and [audio](audio.md#buffering) playback.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scrcpy --display-buffer=50 # add 50ms buffering for display
|
scrcpy --video-buffer=50 # add 50ms buffering for video playback
|
||||||
scrcpy --v4l2-buffer=300 # add 300ms buffering for v4l2 sink
|
|
||||||
scrcpy --audio-buffer=200 # set 200ms buffering for audio playback
|
scrcpy --audio-buffer=200 # set 200ms buffering for audio playback
|
||||||
|
scrcpy --v4l2-buffer=300 # add 300ms buffering for v4l2 sink
|
||||||
```
|
```
|
||||||
|
|
||||||
They can be applied simultaneously:
|
They can be applied simultaneously:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
scrcpy --display-buffer=50 --v4l2-buffer=300
|
scrcpy --video-buffer=50 --v4l2-buffer=300
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user