GithubHelp home page GithubHelp logo

Comments (5)

tkarabela avatar tkarabela commented on May 24, 2024
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.

X-C0DE avatar X-C0DE commented on May 24, 2024

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.

tkarabela avatar tkarabela commented on May 24, 2024

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.

tkarabela avatar tkarabela commented on May 24, 2024

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.

moi15moi avatar moi15moi commented on May 24, 2024

Here is how SubstitleEdit implemented it:

How it "detect" the presence of X-TIMESTAMP-MAP

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.