Skip to content

Commit

Permalink
Make --audio-codec=raw the default
Browse files Browse the repository at this point in the history
Encoding and decoding the audio stream adds latency, which is not ideal
for real-time mirroring.

PR #3757 <#3757>
  • Loading branch information
rom1v committed Mar 3, 2023
1 parent 29e47bd commit bac8119
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/scrcpy.1
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Default is 0 (no buffering).
.BI "\-\-audio\-codec " name
Select an audio codec (raw, opus or aac).

Default is opus.
Default is raw.

.TP
.BI "\-\-audio\-encoder " name
Expand Down
2 changes: 1 addition & 1 deletion app/src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static const struct sc_option options[] = {
.longopt = "audio-codec",
.argdesc = "name",
.text = "Select an audio codec (raw, opus or aac).\n"
"Default is opus.",
"Default is raw.",
},
{
.longopt_id = OPT_AUDIO_CODEC_OPTIONS,
Expand Down
2 changes: 1 addition & 1 deletion app/src/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const struct scrcpy_options scrcpy_options_default = {
#endif
.log_level = SC_LOG_LEVEL_INFO,
.video_codec = SC_CODEC_H264,
.audio_codec = SC_CODEC_OPUS,
.audio_codec = SC_CODEC_RAW,
.record_format = SC_RECORD_FORMAT_AUTO,
.keyboard_input_mode = SC_KEYBOARD_INPUT_MODE_INJECT,
.mouse_input_mode = SC_MOUSE_INPUT_MODE_INJECT,
Expand Down
2 changes: 1 addition & 1 deletion app/src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ execute_server(struct sc_server *server,
ADD_PARAM("video_codec=%s",
sc_server_get_codec_name(params->video_codec));
}
if (params->audio_codec != SC_CODEC_OPUS) {
if (params->audio_codec != SC_CODEC_RAW) {
ADD_PARAM("audio_codec=%s",
sc_server_get_codec_name(params->audio_codec));
}
Expand Down
2 changes: 1 addition & 1 deletion server/src/main/java/com/genymobile/scrcpy/Options.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class Options {
private boolean audio = true;
private int maxSize;
private VideoCodec videoCodec = VideoCodec.H264;
private AudioCodec audioCodec = AudioCodec.OPUS;
private AudioCodec audioCodec = AudioCodec.RAW;
private int videoBitRate = 8000000;
private int audioBitRate = 196000;
private int maxFps;
Expand Down

0 comments on commit bac8119

Please sign in to comment.