Caner Ateş
64ae6e43c5
支持配置 fmp4 HLS 切片文件扩展名 (.mp4/.m4s) ( #4746 )
...
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
DockerPy / build (push) Has been cancelled
Linux / build (push) Has been cancelled
Linux_Python / build (push) Has been cancelled
macOS / build (push) Has been cancelled
macOS_Python / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Windows_Python / build (push) Has been cancelled
## 背景 / 问题
fmp4 模式下,HLS 切片文件名被硬编码为 `.mp4`(见 `HlsMakerImp::onOpenSegment`),无法改用 fmp4
媒体段更规范、更常见的 `.m4s` 扩展名(`init` 段用 `init.mp4`、媒体段用 `.m4s` 是 CMAF/DASH
的通行约定)。
## 改动
- 新增配置项 `hls.fmp4SegExt`,默认 `.mp4`,**完全向后兼容**;用户可设为 `.m4s`。
- `init` 段仍固定为 `init.mp4`,mpegts 切片仍为 `.ts`,相关行为不变。
- 切片文件名同时用作 m3u8 中的分片 URI,因此扩展名变更后 playlist 自动保持一致,无需额外同步。
- 在 HTTP MIME 表中注册 `.m4s` -> `video/mp4`;否则会以 `text/plain` 返回,导致 Safari
等播放器无法播放 HLS-fmp4。
- 配置值不带前导点(如 `m4s`)时自动规范化为 `.m4s`。
## 涉及文件
`src/Common/config.h`、`src/Common/config.cpp`、`src/Record/HlsRecorder.h`、`src/Record/HlsMakerImp.h`、`src/Record/HlsMakerImp.cpp`、`src/Http/HttpConst.cpp`、`conf/config.ini`
## 测试
- **默认(未配置)**:切片仍为 `*.mp4`,`init` 为 `init.mp4`,行为与改动前一致(回归正常)。
- **`hls.fmp4SegExt=.m4s`**:切片文件为 `*_N.m4s`,m3u8 中 `#EXTINF` 的 URI 指向
`.m4s`,`#EXT-X-MAP` 仍为 `init.mp4`;HTTP 拉取切片返回 `Content-Type:
video/mp4`;hls.js 与 Safari 播放正常。
- **`hls.fmp4SegExt=m4s`(无前导点)**:自动规范化,仍生成 `*.m4s`。
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08 21:25:25 +08:00
xia-chu
18d5fb71f3
增强hls点播功能,每个切片文件夹生成一个m3u8索引文件
2024-10-26 16:42:06 +08:00
alex
4152dcd409
AI automatically translates all comments in the code into English ( #3917 )
2024-09-19 14:53:50 +08:00
xia-chu
390c374086
Optimize the code
...
1. change param_strs to params
2. move params from MediaInfo to MediaTuple
3. passing MediaTuple as a parameter for some functions
2024-03-30 14:41:20 +08:00
SetoKaiba
b6cbbb4339
Add hls_delay feature ( #3158 )
2024-01-03 09:05:15 +08:00
夏楚
bbe8f4a018
release 8.0
2023-12-09 16:23:51 +08:00
xiongziliang
3137b95406
修复hls快速重连时,延迟删除文件夹相关bug ( #3039 )
2023-12-02 21:53:24 +08:00
XiaoYan Lin
cb0579a16d
新增支持hls-fmp4直播( #2603 #977 #1965 )
...
同时主要优化点包括:
1、编译宏特性开关优化。
2、转协议复用器相关创建代码移动至Recorder类。
3、转协议复用器onAllTrackReady函数修改为addTrackCompleted。
4、startRecord/stopRecord/isRecording接口新增支持ts/fmp4/hls-fmp4协议。
Co-authored-by: xia-chu <771730766@qq.com>
Co-authored-by: linxiaoyan87 <linxiaoyan87@foxmail.com>
2023-07-02 12:02:33 +08:00
ziyue
9c3b8a6a95
时间戳改为64位
2022-08-08 17:13:39 +08:00
WuPeng
5bc313bafe
增加长期保存hls切片的功能,segKeep=0为不长期保存,segKeep=1为长期保存。此功能部分等效于segNum=0的情况,不同的是这个保留不会在m3u8文件中体现。
2022-05-10 17:32:50 +08:00
xiongziliang
83c1f29253
HLS: 解决hls断流重新生成后异常的bug
2022-02-13 21:06:32 +08:00
ziyue
49fc17d7e0
hls m3u8文件直接通过内存读写
2022-02-11 16:21:19 +08:00
夏楚
c72cf4cbcc
整理命名空间 ( #1409 )
...
* feat: remove using namespace mediakit in header files.
(cherry picked from commit d44aeb339a8a0e1f0455be82b21fe4b1b536299f)
* feat: remove using namespace mediakit in FFmpegSource.h
* feat: remove using namespace mediakit in RtpExt.h
* feat: remove using namespace mediakit in header files.
* feat: remove using namespace std in header files.
* feat: remove using namespace std in header files when zltoolkit remove std in header
* 补充命名空间
* 整理命名空间
* 整理命名空间2
* 修复macos ci
* 修复编译问题
* 修复编译问题2
* 修复编译问题3
Co-authored-by: Johnny <hellojinqiang@gmail.com>
Co-authored-by: Xiaofeng Wang <wasphin@gmail.com>
2022-02-02 20:34:50 +08:00
ziyue
e8c9666af0
支持hls直播文件延时删除: #913
2021-06-23 10:30:58 +08:00
xia-chu
b6cbc87712
全面整理代码,去除编译警告
2021-01-17 18:31:50 +08:00
xiongziliang
f84981dc75
合并pr(添加录制ts完成通知): #479
2020-09-20 11:40:42 +08:00
wxf
748bb8e488
统一 mp4 及 ts 录像信息定义
2020-09-15 19:09:26 +08:00
wxf
188e087fc2
添加 hls ts 切片录制完成通知
2020-09-14 13:20:45 +08:00
xiongziliang
be1e872f0c
完善按需转协议(包括hls)
2020-09-12 19:20:18 +08:00
xiongziliang
7019e4717c
整理授权协议
2020-04-04 20:30:09 +08:00
xiongziliang
54736859d4
基本完成hls相关的主要事件
2019-12-29 10:49:04 +08:00
xiongziliang
1afacdcff8
初步添加HlsMediaSource
2019-12-28 18:50:56 +08:00
xiongziliang
a1e5724c70
优化hls录制
2019-12-17 09:18:11 +08:00
xiongziliang
5fe5dd9de6
hls保存ts文件时根据日期、时间保存
2019-12-12 22:58:31 +08:00
xiongziliang
de33d6a847
整理文件录制
2019-12-04 10:45:38 +08:00