Skip to content

segator/PgsToSrt

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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 \
           segator/pgstosrt

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

About

PGS to Srt converter

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%