Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

PGS to Srt converter

NotificationsYou must be signed in to change notification settings

Tentacule/PgsToSrt

Repository files navigation

ConvertPGS subtitles toSRT usingOCR.

Prerequisites

Data files must be placed in thetessdata 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]

ParameterDescription
--inputInput filename, can be an mkv file or pgs subtitle extracted to a .sup file with mkvextract.
--outputOutput SubRip (.srt) filename. Auto generated from input filename if not set.
--trackTrack number of the subtitle to process in an.mkv file (only required when input is a matroska file)
This can be obtained withmkvinfo
--tracklanguageConvert all tracks of the specified language (only works with.mkv input)
--tesseractlanguageTesseract language to use if multiple languages are available in the tesseract data directory.
--tesseractdataPath of tesseract language data files, by defaulttessdata in the executable directory.
--tesseractversionlibtesseract version, support 4 and 5 (default: 4) (ignored on Windows platform)
--libleptnameleptonica library name, usually lept or leptonica, 'lib' prefix is automatically added (default: lept) (ignored on Windows platform)
--libleptversionleptonica library version (default: 5) (ignored on Windows platform)

Example (Command Line)

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

Example (Docker)

Examimeentrypoint.sh for a full list of all available arguments.

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

Hint: The default arguments coming fromDockerfile areINPUT=/input.sup andOUTPUT=/output.srt, so you can easily:

touch output-file.srt# This needs to be a file, otherwise Docker will just assume it's a directory mount and it will fail.docker run --it -rm \    -v source-file.sup:/input.sup \    -v output-file.srt:/output.srt \    -e LANGUAGE=eng \    tentacule/pgstosrt

Dependencies

  • Windows : none, tesseract/leptonica libraries are included in the release package.
  • Linux : libtesseract5 (sudo apt install libtesseract5 or whatever your distro requires)

Build

To build PgsToSrt.dll execute the following commands in thesrc/ directory:

dotnet restoredotnet publish -c Release -o out --framework net6.0# The file produced is  PgsToSrt/out/PgsToSrt.dll

To build a Docker image for all languages:

make build-all

To build a docker image for a single language:

make build-single LANGUAGE=eng# or any other Tessaract-available language code

Built With


[8]ページ先頭

©2009-2025 Movatter.jp