Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Z
ZLMediaKit
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
张翔宇
ZLMediaKit
Commits
ee66d945
Commit
ee66d945
authored
5 years ago
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新media-server库
parent
2a518493
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
17 行删除
+13
-17
3rdpart/media-server
+1
-1
src/Extension/Factory.cpp
+10
-14
src/Record/MP4Muxer.cpp
+2
-2
没有找到文件。
media-server
@
8d40dad3
Subproject commit
4325386be318889b7815cdd86a2e83f05a059c8
1
Subproject commit
8d40dad3dbdce171756691d4511aca49fcf2a23
1
This diff is collapsed.
Click to expand it.
src/Extension/Factory.cpp
查看文件 @
ee66d945
...
...
@@ -180,6 +180,9 @@ CodecId Factory::getCodecIdByAmf(const AMFValue &val){
if
(
str
==
"mp4a"
){
return
CodecAAC
;
}
if
(
str
==
"hev1"
||
str
==
"hvc1"
){
return
CodecH265
;
}
WarnL
<<
"暂不支持该Amf:"
<<
str
;
return
CodecInvalid
;
}
...
...
@@ -187,12 +190,9 @@ CodecId Factory::getCodecIdByAmf(const AMFValue &val){
if
(
val
.
type
()
!=
AMF_NULL
){
auto
type_id
=
val
.
as_integer
();
switch
(
type_id
){
case
7
:{
return
CodecH264
;
}
case
10
:{
return
CodecAAC
;
}
case
7
:
return
CodecH264
;
case
10
:
return
CodecAAC
;
case
12
:
return
CodecH265
;
default
:
WarnL
<<
"暂不支持该Amf:"
<<
type_id
;
return
CodecInvalid
;
...
...
@@ -219,14 +219,10 @@ RtmpCodec::Ptr Factory::getRtmpCodecByTrack(const Track::Ptr &track) {
AMFValue
Factory
::
getAmfByCodecId
(
CodecId
codecId
)
{
switch
(
codecId
){
case
CodecAAC
:{
return
AMFValue
(
"mp4a"
);
}
case
CodecH264
:{
return
AMFValue
(
"avc1"
);
}
default
:
return
AMFValue
(
AMF_NULL
);
case
CodecAAC
:
return
AMFValue
(
"mp4a"
);
case
CodecH264
:
return
AMFValue
(
"avc1"
);
case
CodecH265
:
return
AMFValue
(
12
);
default
:
return
AMFValue
(
AMF_NULL
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/Record/MP4Muxer.cpp
查看文件 @
ee66d945
...
...
@@ -152,7 +152,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) {
struct
mpeg4_avc_t
avc
;
string
sps_pps
=
string
(
"
\x00\x00\x00\x01
"
,
4
)
+
h264_track
->
getSps
()
+
string
(
"
\x00\x00\x00\x01
"
,
4
)
+
h264_track
->
getPps
();
h264_annexbtomp4
(
&
avc
,
sps_pps
.
data
(),
sps_pps
.
size
(),
NULL
,
0
,
NULL
);
h264_annexbtomp4
(
&
avc
,
sps_pps
.
data
(),
sps_pps
.
size
(),
NULL
,
0
,
NULL
,
NULL
);
uint8_t
extra_data
[
1024
];
int
extra_data_size
=
mpeg4_avc_decoder_configuration_record_save
(
&
avc
,
extra_data
,
sizeof
(
extra_data
));
...
...
@@ -186,7 +186,7 @@ void MP4Muxer::addTrack(const Track::Ptr &track) {
string
vps_sps_pps
=
string
(
"
\x00\x00\x00\x01
"
,
4
)
+
h265_track
->
getVps
()
+
string
(
"
\x00\x00\x00\x01
"
,
4
)
+
h265_track
->
getSps
()
+
string
(
"
\x00\x00\x00\x01
"
,
4
)
+
h265_track
->
getPps
();
h265_annexbtomp4
(
&
hevc
,
vps_sps_pps
.
data
(),
vps_sps_pps
.
size
(),
NULL
,
0
,
NULL
);
h265_annexbtomp4
(
&
hevc
,
vps_sps_pps
.
data
(),
vps_sps_pps
.
size
(),
NULL
,
0
,
NULL
,
NULL
);
uint8_t
extra_data
[
1024
];
int
extra_data_size
=
mpeg4_hevc_decoder_configuration_record_save
(
&
hevc
,
extra_data
,
sizeof
(
extra_data
));
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论