Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
1e5b3f77
Commit
1e5b3f77
authored
Sep 06, 2020
by
Gyan Doshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/libopusenc: add option to set inband FEC
parent
99e12b57
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
encoders.texi
doc/encoders.texi
+5
-0
libopusenc.c
libavcodec/libopusenc.c
+9
-0
No files found.
doc/encoders.texi
View file @
1e5b3f77
...
@@ -953,6 +953,11 @@ The default is 20ms.
...
@@ -953,6 +953,11 @@ The default is 20ms.
@item packet_loss (@emph{expect-loss})
@item packet_loss (@emph{expect-loss})
Set expected packet loss percentage. The default is 0.
Set expected packet loss percentage. The default is 0.
@item fec (@emph{n/a})
Enable inband forward error correction. @option{packet_loss} must be non-zero
to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss.
Default is disabled.
@item application (N.A.)
@item application (N.A.)
Set intended application type. Valid options are listed below:
Set intended application type. Valid options are listed below:
...
...
libavcodec/libopusenc.c
View file @
1e5b3f77
...
@@ -34,6 +34,7 @@ typedef struct LibopusEncOpts {
...
@@ -34,6 +34,7 @@ typedef struct LibopusEncOpts {
int
vbr
;
int
vbr
;
int
application
;
int
application
;
int
packet_loss
;
int
packet_loss
;
int
fec
;
int
complexity
;
int
complexity
;
float
frame_duration
;
float
frame_duration
;
int
packet_size
;
int
packet_size
;
...
@@ -149,6 +150,13 @@ static int libopus_configure_encoder(AVCodecContext *avctx, OpusMSEncoder *enc,
...
@@ -149,6 +150,13 @@ static int libopus_configure_encoder(AVCodecContext *avctx, OpusMSEncoder *enc,
"Unable to set expected packet loss percentage: %s
\n
"
,
"Unable to set expected packet loss percentage: %s
\n
"
,
opus_strerror
(
ret
));
opus_strerror
(
ret
));
ret
=
opus_multistream_encoder_ctl
(
enc
,
OPUS_SET_INBAND_FEC
(
opts
->
fec
));
if
(
ret
!=
OPUS_OK
)
av_log
(
avctx
,
AV_LOG_WARNING
,
"Unable to set inband FEC: %s
\n
"
,
opus_strerror
(
ret
));
if
(
avctx
->
cutoff
)
{
if
(
avctx
->
cutoff
)
{
ret
=
opus_multistream_encoder_ctl
(
enc
,
ret
=
opus_multistream_encoder_ctl
(
enc
,
OPUS_SET_MAX_BANDWIDTH
(
opts
->
max_bandwidth
));
OPUS_SET_MAX_BANDWIDTH
(
opts
->
max_bandwidth
));
...
@@ -544,6 +552,7 @@ static const AVOption libopus_options[] = {
...
@@ -544,6 +552,7 @@ static const AVOption libopus_options[] = {
{
"lowdelay"
,
"Restrict to only the lowest delay modes"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
OPUS_APPLICATION_RESTRICTED_LOWDELAY
},
0
,
0
,
FLAGS
,
"application"
},
{
"lowdelay"
,
"Restrict to only the lowest delay modes"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
OPUS_APPLICATION_RESTRICTED_LOWDELAY
},
0
,
0
,
FLAGS
,
"application"
},
{
"frame_duration"
,
"Duration of a frame in milliseconds"
,
OFFSET
(
frame_duration
),
AV_OPT_TYPE_FLOAT
,
{
.
dbl
=
20
.
0
},
2
.
5
,
120
.
0
,
FLAGS
},
{
"frame_duration"
,
"Duration of a frame in milliseconds"
,
OFFSET
(
frame_duration
),
AV_OPT_TYPE_FLOAT
,
{
.
dbl
=
20
.
0
},
2
.
5
,
120
.
0
,
FLAGS
},
{
"packet_loss"
,
"Expected packet loss percentage"
,
OFFSET
(
packet_loss
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
100
,
FLAGS
},
{
"packet_loss"
,
"Expected packet loss percentage"
,
OFFSET
(
packet_loss
),
AV_OPT_TYPE_INT
,
{
.
i64
=
0
},
0
,
100
,
FLAGS
},
{
"fec"
,
"Enable inband FEC. Expected packet loss must be non-zero"
,
OFFSET
(
fec
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"vbr"
,
"Variable bit rate mode"
,
OFFSET
(
vbr
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
2
,
FLAGS
,
"vbr"
},
{
"vbr"
,
"Variable bit rate mode"
,
OFFSET
(
vbr
),
AV_OPT_TYPE_INT
,
{
.
i64
=
1
},
0
,
2
,
FLAGS
,
"vbr"
},
{
"off"
,
"Use constant bit rate"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
0
},
0
,
0
,
FLAGS
,
"vbr"
},
{
"off"
,
"Use constant bit rate"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
0
},
0
,
0
,
FLAGS
,
"vbr"
},
{
"on"
,
"Use variable bit rate"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
0
,
0
,
FLAGS
,
"vbr"
},
{
"on"
,
"Use variable bit rate"
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
1
},
0
,
0
,
FLAGS
,
"vbr"
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment