Giter Club home page Giter Club logo

mp4subtitleparser's Introduction

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 <segments dir> <segments search pattern> [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

(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
...

mp4subtitleparser's People

Contributors

nilaoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mp4subtitleparser's Issues

Data at the root level is invalid. Line 1, position 39.

Hi,
when i try your example "samples-ttml" it works fine, but "samples-ttml(no init, need offset)" it always gives the error "Data at the root level is invalid. Line 1, position 39." With your init, or with my init too.
Any idea what's wrong?

Thanks

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.