Comments (5)
WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:368640
Yes, the X-TIMESTAMP-MAP
seems to be specifying an offset of subtitle times vs. media times ( https://sdks.support.brightcove.com/features/synchronizing-webvtt-captions.html ), though this is not part of the standard ( https://www.w3.org/TR/webvtt1/ ).
To handle this, it would be necessary to know what is the time scale of the MPEGTS
timestamp:
- Is it 368640 * 1 microsecond?
- Is it 368640 * some constant defined in the MPEG-TS standard?
- Does it depend on the input file? (let's hope not)
from pysubs2.
to solve this problem i made a workarround 🤣
delay = TIMESTAMP / 90
so I take this delay value in ms and apply it to the whole subtitle
from pysubs2.
It would be good to have some support for this, but I'm not sure how to implement this. If anyone has experience with X-TIMESTAMP-MAP
, feel free to point me in the right direction or open a pull request.
from pysubs2.
Note for implementation of X-TIMESTAMP-MAP
: The MPEG timestamps should be Presentation Timestamps (PES) with one unit being 1/90000 s. See also https://www.rfc-editor.org/rfc/rfc8216#section-3.5
from pysubs2.
Here is how SubstitleEdit implemented it:
How it "detect" the presence of X-TIMESTAMP-MAP
- https://github.com/SubtitleEdit/subtitleedit/blob/1304bccf757009d8b234f60fa7cc7e951ba46447/src/libse/SubtitleFormats/WebVTT.cs#L270-L274
- https://github.com/SubtitleEdit/subtitleedit/blob/1304bccf757009d8b234f60fa7cc7e951ba46447/src/libse/SubtitleFormats/WebVTT.cs#L233-L248
The function that return of how much the subtitle need to be delayed:
Here is how an fork of ffmpeg (not official ffmpeg !) implemented it: anssih/FFmpeg@65af023
from pysubs2.
Related Issues (20)
- Possible integration point with openai/whisper output HOT 4
- Support for Graphics section HOT 3
- [QA] DeprecationWarning in tests: 'alignment' attribute should be an Alignment instance
- SRT to ASS conversion cap at 10h timecode HOT 2
- tutorial.rst has a spelling issue in line 60 HOT 1
- [Feature Request] Handle WebVtt cue settings HOT 2
- Error: Framerate must be specified when writing MicroDVD. HOT 1
- ASS to SRT/WebVTT cue ordering HOT 2
- Is there a way to add braces to the SRT file? HOT 4
- microdvd parser should read fps only from first line with {1}{1} prefix HOT 11
- Python inline convert sup to srt HOT 3
- Support for OpenAI Whisper transcription from CLI HOT 2
- remove misc. events problem. HOT 1
- 4 tests fail because of the missing file subtitle_with_attached_fonts_no_events.ass HOT 1
- Incorrect time after the shift
- add format sami = smi
- Suggestion: display the help message when pysubs2 is run from CLI without any arguments HOT 2
- Timestamp rounding error results in incorrect timestamp and overlapping lines HOT 2
- UnknownFileExtensionError not properly raised upon loading a file with unsupported format HOT 1
- Is that possible to initial a SSAevent object directly? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysubs2.