Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
138
Issues
138
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
4200de27
Commit
4200de27
authored
Oct 01, 2020
by
Pierre Lespagnol
Committed by
Adrien Béraud
Oct 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encoder: fix vp8 init + cleanup
Change-Id: Id1046f0f37bacf2687da0e37893817ae0bdab162
parent
c7b29b08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
src/media/media_encoder.cpp
src/media/media_encoder.cpp
+12
-8
No files found.
src/media/media_encoder.cpp
View file @
4200de27
...
...
@@ -608,7 +608,7 @@ MediaEncoder::prepareEncoderContext(AVCodec* outputCodec, bool is_video)
encoderCtx
->
sample_rate
=
std
::
max
(
8000
,
audioOpts_
.
sampleRate
);
encoderCtx
->
time_base
=
AVRational
{
1
,
encoderCtx
->
sample_rate
};
if
(
audioOpts_
.
nbChannels
>
2
||
audioOpts_
.
nbChannels
<
1
)
{
encoderCtx
->
channels
=
std
::
max
(
std
::
min
(
audioOpts_
.
nbChannels
,
1
)
,
2
);
encoderCtx
->
channels
=
std
::
clamp
(
audioOpts_
.
nbChannels
,
1
,
2
);
JAMI_ERR
()
<<
"["
<<
encoderName
<<
"] Clamping invalid channel count: "
<<
audioOpts_
.
nbChannels
<<
" -> "
<<
encoderCtx
->
channels
;
...
...
@@ -943,14 +943,18 @@ MediaEncoder::initVP8(AVCodecContext* encoderCtx, uint64_t br)
av_opt_set_int
(
encoderCtx
,
"drop-frame"
,
25
,
AV_OPT_SEARCH_CHILDREN
);
av_opt_set_int
(
encoderCtx
,
"undershoot-pct"
,
95
,
AV_OPT_SEARCH_CHILDREN
);
// don't set encoderCtx->gop_size: let libvpx decide when to insert a keyframe
encoderCtx
->
slices
=
2
;
// VP8E_SET_TOKEN_PARTITIONS
encoderCtx
->
qmin
=
4
;
encoderCtx
->
qmax
=
56
;
crf
=
std
::
min
(
encoderCtx
->
qmax
,
std
::
max
((
int
)
crf
,
encoderCtx
->
qmin
)
);
av_opt_set_int
(
encoderCtx
,
"slices"
,
2
,
AV_OPT_SEARCH_CHILDREN
)
;
// VP8E_SET_TOKEN_PARTITIONS
av_opt_set_int
(
encoderCtx
,
"qmax"
,
56
,
AV_OPT_SEARCH_CHILDREN
)
;
av_opt_set_int
(
encoderCtx
,
"qmin"
,
4
,
AV_OPT_SEARCH_CHILDREN
)
;
crf
=
std
::
clamp
((
int
)
crf
,
4
,
56
);
av_opt_set_int
(
encoderCtx
,
"crf"
,
crf
,
AV_OPT_SEARCH_CHILDREN
);
encoderCtx
->
rc_buffer_size
=
bufSize
;
encoderCtx
->
rc_max_rate
=
maxBitrate
;
JAMI_DBG
(
"VP8 encoder setup: crf=%u, maxrate=%lu, bufsize=%lu"
,
crf
,
maxBitrate
,
maxBitrate
);
av_opt_set_int
(
encoderCtx
,
"b"
,
maxBitrate
,
AV_OPT_SEARCH_CHILDREN
);
av_opt_set_int
(
encoderCtx
,
"maxrate"
,
maxBitrate
,
AV_OPT_SEARCH_CHILDREN
);
av_opt_set_int
(
encoderCtx
,
"bufsize"
,
bufSize
,
AV_OPT_SEARCH_CHILDREN
);
JAMI_DBG
(
"VP8 encoder setup: crf=%u, maxrate=%lu, bufsize=%lu"
,
crf
,
maxBitrate
/
1000
,
bufSize
/
1000
);
}
}
...
...
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