Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多段时间码合并后的mp4不正常 #57

Open
Mishasama opened this issue Oct 21, 2024 · 3 comments
Open

多段时间码合并后的mp4不正常 #57

Mishasama opened this issue Oct 21, 2024 · 3 comments

Comments

@Mishasama
Copy link

!time:01:49:36-01:50:50,!time:01:53:37-01:54:50

这样合并后的文件用的是原始m3u8的时间长度信息,在mp4的元数据里显示是一个5分半的文件。

这样的文件无法被大多数常规播放器正常解码并播放。只有极少数能忽略元数据把它当成TS读的播放器能凑合解码有数据的时间段。

对于这种情况,必须在最终阶段进行remux,根据实际的视频流信息来重新生成输出的mp4的元数据才能生成能正常播放的mp4文件。

@orestonce
Copy link
Owner

这个暂无办法解决

@Mishasama
Copy link
Author

这个暂无办法解决

有变通办法

  1. 当参数中包含一个以上的时间段时,先下载其对应的所有ts文件
  2. 然后在合并阶段将每一个时间段作为一次单独的合并流程来处理,对后续的时间段进行队列处理
  3. 对于使用队列处理的情况,对所有输出的文件名末端插入时间码以避免重名问题(我个人在文件名中使用的时间码格式是 [01h23m45s - 02h34m56s] 这样来避免冒号问题)
  4. 后续如果用户有需要,可以自行使用第三方工具进行合并和remux得出正常的mp4文件

实际上我们只需要提供一个可以方便的批量下载多个分段的功能就可以了。

@orestonce
Copy link
Owner

就是每个分段分别合并,也行吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants