Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
尘离序散
obs-studio
提交
3ddab3ca
O
obs-studio
项目概览
尘离序散
/
obs-studio
与 Fork 源项目一致
从无法访问的项目Fork
通知
30
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obs-studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
3ddab3ca
编写于
3月 16, 2021
作者:
J
jpark37
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
obs-ffmpeg: Align NVENC buffer length
Compute buffer count according to FFmpeg logic.
上级
7e8a04bb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
8 deletion
+24
-8
plugins/obs-ffmpeg/jim-nvenc.c
plugins/obs-ffmpeg/jim-nvenc.c
+24
-8
未找到文件。
plugins/obs-ffmpeg/jim-nvenc.c
浏览文件 @
3ddab3ca
...
...
@@ -42,9 +42,10 @@ struct nvenc_data {
void
*
session
;
NV_ENC_INITIALIZE_PARAMS
params
;
NV_ENC_CONFIG
config
;
size_t
buf_count
;
size_t
output_delay
;
size_t
buffers_queued
;
int
rc_lookahead
;
int
buf_count
;
int
output_delay
;
int
buffers_queued
;
size_t
next_bitstream
;
size_t
cur_bitstream
;
bool
encode_started
;
...
...
@@ -464,9 +465,28 @@ static bool init_encoder(struct nvenc_data *enc, obs_data_t *settings)
/* lookahead */
lookahead
=
nv_get_cap
(
enc
,
NV_ENC_CAPS_SUPPORT_LOOKAHEAD
)
&&
(
lookahead
||
config
->
rcParams
.
enableLookahead
);
if
(
lookahead
)
enc
->
rc_lookahead
=
8
;
int
buf_count
=
max
(
4
,
config
->
frameIntervalP
*
2
*
2
);
if
(
lookahead
)
{
buf_count
=
max
(
buf_count
,
config
->
frameIntervalP
+
enc
->
rc_lookahead
+
EXTRA_BUFFERS
);
}
buf_count
=
min
(
64
,
buf_count
);
enc
->
buf_count
=
buf_count
;
const
int
output_delay
=
buf_count
-
1
;
enc
->
output_delay
=
output_delay
;
if
(
lookahead
)
{
config
->
rcParams
.
lookaheadDepth
=
8
;
int
lkd_bound
=
output_delay
-
config
->
frameIntervalP
-
4
;
config
->
rcParams
.
enableLookahead
=
1
;
config
->
rcParams
.
lookaheadDepth
=
max
(
enc
->
rc_lookahead
,
lkd_bound
);
}
/* psycho aq */
...
...
@@ -529,10 +549,6 @@ static bool init_encoder(struct nvenc_data *enc, obs_data_t *settings)
return
false
;
}
enc
->
buf_count
=
config
->
frameIntervalP
+
config
->
rcParams
.
lookaheadDepth
+
EXTRA_BUFFERS
;
enc
->
output_delay
=
enc
->
buf_count
-
1
;
info
(
"settings:
\n
"
"
\t
rate_control: %s
\n
"
"
\t
bitrate: %d
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录