mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00
Add Opus FEC options to rtp_encode tool
Bug: None Change-Id: I7be70951c20069207963b0fa43564c4008eda870 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318220 Commit-Queue: Henrik Lundin <henrik.lundin@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/main@{#40668}
This commit is contained in:
parent
578e660527
commit
9a9b462e16
2 changed files with 6 additions and 1 deletions
1
AUTHORS
1
AUTHORS
|
@ -80,6 +80,7 @@ Maksim Sisov <msisov@igalia.com>
|
|||
Maxim Pavlov <pavllovmax@gmail.com>
|
||||
Maxim Potapov <vopatop.skam@gmail.com>
|
||||
Michael Iedema <michael@kapsulate.com>
|
||||
Michael Klingbeil <klingm@amazon.com>
|
||||
Michał Zarach <michalzaq12@gmail.com>
|
||||
Michel Promonet <michel.promonet.1@gmail.com>
|
||||
Miguel Paris <mparisdiaz@gmail.com>
|
||||
|
|
|
@ -42,7 +42,7 @@ ABSL_FLAG(int,
|
|||
frame_len,
|
||||
0,
|
||||
"Frame length in ms; 0 indicates codec default value");
|
||||
ABSL_FLAG(int, bitrate, 0, "Bitrate in kbps; 0 indicates codec default value");
|
||||
ABSL_FLAG(int, bitrate, 0, "Bitrate in bps; 0 indicates codec default value");
|
||||
ABSL_FLAG(int,
|
||||
payload_type,
|
||||
-1,
|
||||
|
@ -54,6 +54,8 @@ ABSL_FLAG(int,
|
|||
ABSL_FLAG(int, ssrc, 0, "SSRC to write to the RTP header");
|
||||
ABSL_FLAG(bool, dtx, false, "Use DTX/CNG");
|
||||
ABSL_FLAG(int, sample_rate, 48000, "Sample rate of the input file");
|
||||
ABSL_FLAG(bool, fec, false, "Use Opus FEC");
|
||||
ABSL_FLAG(int, expected_loss, 0, "Expected packet loss percentage");
|
||||
|
||||
namespace webrtc {
|
||||
namespace test {
|
||||
|
@ -202,6 +204,7 @@ std::unique_ptr<AudioEncoder> CreateEncoder(CodecType codec_type,
|
|||
config.bitrate_bps = absl::GetFlag(FLAGS_bitrate);
|
||||
}
|
||||
config.dtx_enabled = absl::GetFlag(FLAGS_dtx);
|
||||
config.fec_enabled = absl::GetFlag(FLAGS_fec);
|
||||
RTC_CHECK(config.IsOk());
|
||||
return AudioEncoderOpus::MakeAudioEncoder(config, payload_type);
|
||||
}
|
||||
|
@ -309,6 +312,7 @@ int RunRtpEncode(int argc, char* argv[]) {
|
|||
const int timestamp_rate_hz = codec->RtpTimestampRateHz();
|
||||
auto acm(AudioCodingModule::Create());
|
||||
acm->SetEncoder(std::move(codec));
|
||||
acm->SetPacketLossRate(absl::GetFlag(FLAGS_expected_loss));
|
||||
|
||||
// Open files.
|
||||
printf("Input file: %s\n", args[1]);
|
||||
|
|
Loading…
Reference in a new issue