https://github.com/nilaoda/mp4subtitleparser
从 mp4 中提取 wvtt/ttml 字幕. Extract embed wvtt/ttml subtitle in mp4.
https://github.com/nilaoda/mp4subtitleparser
ttml vtt
Last synced: 5 months ago
JSON representation
从 mp4 中提取 wvtt/ttml 字幕. Extract embed wvtt/ttml subtitle in mp4.
- Host: GitHub
- URL: https://github.com/nilaoda/mp4subtitleparser
- Owner: nilaoda
- Created: 2021-09-05T13:45:19.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-11-29T02:42:08.000Z (over 2 years ago)
- Last Synced: 2025-01-13T13:11:19.231Z (5 months ago)
- Topics: ttml, vtt
- Language: C#
- Homepage:
- Size: 575 KB
- Stars: 41
- Watchers: 3
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Mp4SubtitleParser
Program to extract embed wvtt/ttml subtitle in mp4.
Translated from shaka-player project.
python/js prj: https://github.com/xhlove/dash-subtitle-extractor
# how to split single-file
```
"C:\Bento4-SDK-1-6-0-639.x86_64-microsoft-win32\bin\mp4split.exe" single-file.mp4
```# usage
```
Mp4SubtitleParser [output name] [--segTimeMs=SEGMENT_DUR_IN_MS]
```# wvtt example
```
│ Mp4SubtitleParser.exe
└─samples-vtt
init.mp4
segment-1.0001.mp4
segment-1.0002.mp4
segment-1.0003.mp4
segment-1.0004.mp4
...
``````
Mp4SubtitleParser.exe samples-vtt *.mp4
```you got `output.vtt`
# TTML example
```
│ Mp4SubtitleParser.exe
└─samples-ttml
init.mp4
segment-1.0001.mp4
segment-1.0002.mp4
segment-1.0003.mp4
segment-1.0004.mp4
...
``````
Mp4SubtitleParser.exe samples-ttmls *.mp4
```you got `output.ttml` and `output.srt`
# time offset for TTML
in that case, every segment's basetime is `00:00:00.000`...
[sample](https://github.com/nilaoda/Mp4SubtitleParser/blob/main/samples/samples-ttml(no%20init%2C%20need%20offset).zip)
(put any ttml `init.mp4` to the folder, so program can recognize ttml header)
```
Mp4SubtitleParser.exe "samples-ttml(no init, need offset)" *.mp4 --segTimeMs=60000
```segment-01 will add offset `+0s`
segment-02 will add offset `+60s`
segment-03 will add offset `+120s`
...