Giter Site home page Giter Site logo

pgstosrt's Introduction

PgsToSrt

Convert pgs subtitles to srt using OCR.

Prerequisites

Data files must be placed in a tessdata folder inside PgsToSrt folder, or the path can be specified in the command line with the --tesseractdata parameter.

You only need data files for the language(s) you want to convert.

Usage

dotnet PgsToSrt.dll [parameters]

Parameters              
--input Input filename, can be an mkv file or pgs subtitle extracted to a .sup file with mkvextract.
--output Output Subrip (.srt) filename. Auto generated from input filename if not set.
--track Track number of the subtitle to process in an mkv file (only required when input is a matroska file)
This can be obtained with mkvinfo
--trackLanguage Convert all tracks of the specified language (only works with mkv input)
--tesseractlanguage Tesseract language to use if multiple languages are available in the tesseract data directory.
--tesseractdata Path of tesseract language data files, by default 'tessdata' in the executable directory.

Example (Command Line)

dotnet PgsToSrt.dll --input video1.fr.sup --output video1.fr.srt --tesseractlanguage fra
dotnet PgsToSrt.dll --input video1.mkv --output video1.srt --track 4

Example (Docker)

docker run -it --rm -v /data:/data \
           -e INPUT=/data/myImageSubtitle.sup \
           -e OUTPUT=/data/myTextSubtitle.srt \
           -e LANGUAGE=eng \
           tentacule/pgstosrt

Dependencies

  • Windows : none, tesseract/leptonica libraries are included in the release package.
  • Linux : libtesseract4 (sudo apt install libtesseract4)

Build

To build PgsToSrt.dll execute this commands

dotnet restore
dotnet publish -c Release -o out
#The file is on  PgsToSrt/out/PgsToSrt.dll

To build docker image (for now only for linux)

docker build -t pgstosrt .

Built With

pgstosrt's People

Contributors

robertbaker avatar segator avatar tentacule avatar

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.