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
a9b0ca9c
Commit
a9b0ca9c
authored
Aug 01, 2020
by
xiongziliang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hls支持opus
parent
df49d6a7
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
31 行增加
和
64 行删除
+31
-64
3rdpart/media-server
+1
-1
README.md
+3
-3
README_en.md
+2
-60
src/Record/TsMuxer.cpp
+5
-0
src/Rtp/Decoder.cpp
+20
-0
没有找到文件。
media-server
@
94142587
Subproject commit
43facc343afc2b5b70bbbc3c177f20dfa936f2bf
Subproject commit
94142587a615cfb588bbfc663bc05a1c4a82d1cb
README.md
查看文件 @
a9b0ca9c
...
...
@@ -19,7 +19,7 @@
-
提供完整的
[
MediaServer
](
https://github.com/xia-chu/ZLMediaKit/tree/master/server
)
服务器,可以免开发直接部署为商用服务器。
-
提供完善的
[
restful api
](
https://github.com/xia-chu/ZLMediaKit/wiki/MediaServer%E6%94%AF%E6%8C%81%E7%9A%84HTTP-API
)
以及
[
web hook
](
https://github.com/xia-chu/ZLMediaKit/wiki/MediaServer%E6%94%AF%E6%8C%81%E7%9A%84HTTP-HOOK-API
)
,支持丰富的业务逻辑。
-
打通了视频监控协议栈与直播协议栈,对RTSP/RTMP支持都很完善。
-
全面支持H265/H264/AAC/G711。
-
全面支持H265/H264/AAC/G711
/OPUS
。
## 项目定位
...
...
@@ -55,7 +55,7 @@
-
支持HLS文件生成,自带HTTP文件服务器
-
通过cookie追踪技术,可以模拟HLS播放为长连接,可以实现HLS按需拉流、播放统计等业务
-
支持HLS播发器,支持拉流HLS转rtsp/rtmp/mp4
-
支持H264/H265/AAC/G711编码
-
支持H264/H265/AAC/G711
/OPUS
编码
-
HTTP
[
S
]
与WebSocket
-
服务器支持
`目录索引生成`
,
`文件下载`
,
`表单提交请求`
...
...
@@ -68,7 +68,7 @@
-
GB28181与RTP推流
-
支持UDP/TCP国标RTP(PS或TS)推流,可以转换成RTSP/RTMP/HLS等协议
-
支持H264/H265/AAC/G711编码
-
支持H264/H265/AAC/G711
/OPUS
编码
-
MP4点播与录制
-
支持录制为FLV/HLS/MP4
...
...
README_en.md
查看文件 @
a9b0ca9c
...
...
@@ -20,7 +20,7 @@
-
RTSP
[
S
]
player and pusher.
-
RTP Transport :
`rtp over udp`
`rtp over tcp`
`rtp over http`
`rtp udp multicast`
.
-
Basic/Digest/Url Authentication.
-
H26
4/H265/AAC/G711
codec.
-
H26
5/H264/AAC/G711/OPUS
codec.
-
Recorded as mp4.
-
Vod of mp4.
...
...
@@ -28,7 +28,7 @@
-
RTMP
[
S
]
server,support player and pusher.
-
RTMP
[
S
]
player and pusher.
-
Support HTTP-FLV player.
-
H26
4/H265/AAC/G711
codec.
-
H26
5/H264/AAC/G711/OPUS
codec.
-
Recorded as flv or mp4.
-
Vod of mp4.
-
support
[
RTMP-H265
](
https://github.com/ksvc/FFmpeg/wiki
)
...
...
@@ -56,62 +56,6 @@
-
Support TS / PS streaming push through RTP,and it can be converted to RTSP / RTMP / HLS / FLV.
-
Support real-time online screenshot http api.
-
Protocol conversion:
| protocol/codec | H264 | H265 | AAC | other |
| :------------------------------: | :--: | :--: | :--: | :---: |
| RTSP
[
S
]
--> RTMP/HTTP
[
S
]
-FLV/FLV | Y | Y | Y | N |
| RTMP --> RTSP
[
S
]
| Y | Y | Y | N |
| RTSP
[
S
]
--> HLS | Y | Y | Y | N |
| RTMP --> HLS | Y | Y | Y | N |
| RTSP
[
S
]
--> MP4 | Y | Y | Y | N |
| RTMP --> MP4 | Y | Y | Y | N |
| MP4 --> RTSP
[
S
]
| Y | Y | Y | N |
| MP4 --> RTMP | Y | Y | Y | N |
| HLS --> RTSP/RTMP/MP4 | Y | Y | Y | N |
-
Stream generation:
| feature/codec | H264 | H265 | AAC | other |
| :-----------: | :--: | :--: | :--: | :---: |
| RTSP
[
S
]
push | Y | Y | Y | Y |
| RTSP proxy | Y | Y | Y | Y |
| RTMP push | Y | Y | Y | Y |
| RTMP proxy | Y | Y | Y | Y |
-
RTP transport:
| feature/transport | tcp | udp | http | udp_multicast |
| :-----------------: | :--: | :--: | :--: | :-----------: |
| RTSP
[
S
]
Play Server | Y | Y | Y | Y |
| RTSP
[
S
]
Push Server | Y | Y | N | N |
| RTSP Player | Y | Y | N | Y |
| RTSP Pusher | Y | Y | N | N |
-
Server supported:
| Server | Y/N |
| :-----------------: | :--: |
| RTSP
[
S
]
Play Server | Y |
| RTSP
[
S
]
Push Server | Y |
| RTMP | Y |
| HTTP
[
S
]
/WebSocket
[
S
]
| Y |
-
Client supported:
| Client | Y/N |
| :---------: | :--: |
| RTSP Player | Y |
| RTSP Pusher | Y |
| RTMP Player | Y |
| RTMP Pusher | Y |
| HTTP
[
S
]
| Y |
| WebSocket
[
S
]
| Y |
| HLS player | Y |
## System Requirements
-
Compiler support c++11,GCC4.8/Clang3.3/VC2015 or above.
...
...
@@ -191,8 +135,6 @@ git submodule update --init
```
### Build on Android
Now you can open android sudio project in `Android` folder,this is a `aar library` and damo project.
...
...
src/Record/TsMuxer.cpp
查看文件 @
a9b0ca9c
...
...
@@ -73,6 +73,11 @@ void TsMuxer::addTrack(const Track::Ptr &track) {
break
;
}
case
CodecOpus
:
{
_codec_to_trackid
[
track
->
getCodecId
()].
track_id
=
mpeg_ts_add_stream
(
_context
,
PSI_STREAM_AUDIO_OPUS
,
nullptr
,
0
);
break
;
}
default
:
WarnL
<<
"mpeg-ts 不支持该编码格式,已忽略:"
<<
track
->
getCodecName
();
break
;
}
...
...
src/Rtp/Decoder.cpp
查看文件 @
a9b0ca9c
...
...
@@ -15,6 +15,7 @@
#include "Extension/H265.h"
#include "Extension/AAC.h"
#include "Extension/G711.h"
#include "Extension/Opus.h"
#if defined(ENABLE_RTPPROXY) || defined(ENABLE_HLS)
#include "mpeg-ts-proto.h"
...
...
@@ -91,6 +92,7 @@ static const char *getCodecName(int codec_id) {
SWITCH_CASE
(
PSI_STREAM_AUDIO_G722
);
SWITCH_CASE
(
PSI_STREAM_AUDIO_G723
);
SWITCH_CASE
(
PSI_STREAM_AUDIO_G729
);
SWITCH_CASE
(
PSI_STREAM_AUDIO_OPUS
);
default
:
return
"unknown codec"
;
}
}
...
...
@@ -198,6 +200,24 @@ void DecoderImp::onDecode(int stream,int codecid,int flags,int64_t pts,int64_t d
onFrame
(
std
::
make_shared
<
FrameFromPtr
>
(
codec
,
(
char
*
)
data
,
bytes
,
dts
));
break
;
}
case
PSI_STREAM_AUDIO_OPUS
:
{
if
(
!
_codecid_audio
)
{
//获取到音频
_codecid_audio
=
codecid
;
InfoL
<<
"got audio track: opus"
;
auto
track
=
std
::
make_shared
<
OpusTrack
>
();
onTrack
(
track
);
}
if
(
codecid
!=
_codecid_audio
)
{
WarnL
<<
"audio track change to opus from codecid:"
<<
getCodecName
(
_codecid_audio
);
return
;
}
onFrame
(
std
::
make_shared
<
FrameFromPtr
>
(
CodecOpus
,
(
char
*
)
data
,
bytes
,
dts
));
break
;
}
default
:
if
(
codecid
!=
0
){
WarnL
<<
"unsupported codec type:"
<<
getCodecName
(
codecid
)
<<
" "
<<
(
int
)
codecid
;
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论