Giter VIP home page Giter VIP logo

subtitleedit-cli's Introduction

Subtitle Edit cli

.NET 6 console subtitle converter for Windows, Linux, and Mac.

Code is based on SE 3.6.9.

Imaged based formats/OCR was removed.

To update, the SubtitleFormats should be copied from latest SE.

How to compile: dotnet build seconv.csproj

How to run: ./seconv <pattern> <name-of-format-without-spaces> [<optional-parameters>].

E.g.: ./seconv *.sub subrip - for more info see https://www.nikse.dk/subtitleedit/help#commandline

This was made due to SubtitleEdit/subtitleedit#3568

Build and run with docker

Build

Be in the root directory of the repository, then run:

docker build -t seconv:1.0 -f docker/Dockerfile .

This is a multi stage build, it first builds the application, then creates the docker container for execution.

Run

Example:

Navigate to the 'docker' folder, then execute:

docker run --rm -it -v $(pwd)/subtitles:/subtitles seconv:1.0  sample.srt pac

subtitleedit-cli's People

Contributors

niksedk avatar wauter avatar tomac1 avatar

Stargazers

ROBERT MCDOWELL avatar Kaj Kowalski avatar GravityMan avatar Grzesiek W avatar Geová Ramalho dos Santos avatar Archer Allstars avatar  avatar Dreamer avatar Gabriel Weidmann avatar André Ricardo avatar HRXN avatar  avatar Miguel Amaral avatar  avatar Muhammet Ali Köker avatar  avatar  avatar OTTA avatar

Watchers

James Cloos avatar  avatar Muhammet Ali Köker avatar  avatar

subtitleedit-cli's Issues

The /FixCommonErrors function does nothing

Hello,
Thank you very much for the availability of this tool.

Is it possible to implement the /FixCommonErrors function to include it in the docker image, because at the moment the part of the code that should be used for that doesn't seem to work and is commentated. I also found no trace of a class comparable to the RemoveTextForHI class, grouping the feature methods, to try to do something similar to how this other class is used.
I don't have much knowledge in the language used by the project and also don't know the structure of the project.

Thanks for your help

Converting to EBUSTL does not work

Converting to e.g. .pac or .vtt (and others as well!) works fine, using:
docker run --rm -it -v $(pwd)/subtitles:/subtitles seconv:1.0 sample.srt pac
and
docker run --rm -it -v $(pwd)/subtitles:/subtitles seconv:1.0 sample.srt WebVTT
respectively.

However using:
docker run --rm -it -v $(pwd)/subtitles:/subtitles seconv:1.0 sample.srt EBUSTL

Gives me the output :

Commandline-SE - Batch converter

1: sample.srt -> /subtitles/sample.stl... done.

1 file(s) converted in 00:00:00.1437540

But actually no file is created. I've tried digging into the code but I'm not much of a C# guy, so I didn't come up with anything. Copying the latest SubtitleFormats directory gave me build errors. Any ideas?

Convert to PacUnicode does not work

I want to join with a similar problem. I am trying to convert subtitles to PacUnicode.
None of these commands work:

docker run --rm -it -v ${pwd}/subtitles:/subtitles seconv:1.0 ninja.srt PacUnicode
docker run --rm -it -v ${pwd}/subtitles:/subtitles seconv:1.0 ninja.vtt fpc
docker run --rm -it -v ${pwd}/subtitles:/subtitles seconv:1.0 ninja.vtt PAC Unicode (UniPac)
docker run --rm -it -v ${pwd}/subtitles:/subtitles seconv:1.0 ninja.vtt UniPac
I am getting an error: /subtitles/ninja.vtt - target format 'pacunicode' not found!

This is because of the parentheses in the PacUnicode class name "PAC Unicode (UniPac)", or because it is not listed in CommandLineConverter.cs.

Failing to Convert SRT to 890 in Arabic/Hebrew

A simple conversion attempt from srt to 890 fails when in Arabic and Hebrew, but works with english.
seconv functions/srts/s02e01/en_glix.srt Cavena890 -> Works
seconv functions/srts/s02e01/he_glix.srt Cavena890 -> Fails with the error:

1 file(s) converted in 00:00:00.2551974

1: he_glix.srt -> functions/srts/s02e01/he_glix_4.890...
ERROR: Index was outside the bounds of the array.
   at seconv.libse.SubtitleFormats.Cavena890.GetTextAsBytes(String text, Int32 languageId) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/libse/SubtitleFormats/Cavena890.cs:line 692
   at seconv.libse.SubtitleFormats.Cavena890.WriteText(Stream fs, String text, Boolean isLast, Int32 languageIdLine, Boolean useBox) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/libse/SubtitleFormats/Cavena890.cs:line 680
   at seconv.libse.SubtitleFormats.Cavena890.Save(String fileName, Stream stream, Subtitle subtitle, Boolean batchMode) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/libse/SubtitleFormats/Cavena890.cs:line 352
   at seconv.libse.SubtitleFormats.Cavena890.Save(String fileName, Subtitle subtitle, Boolean batchMode) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/libse/SubtitleFormats/Cavena890.cs:line 346
   at seconv.CommandLineConverter.BatchConvertSave(String targetFormat, TimeSpan offset, String deleteContains, TextEncoding targetEncoding, String outputFolder, String targetFileName, Int32 count, Int32& converted, Int32& errors, List`1 formats, String fileName, Subtitle sub, SubtitleFormat format, Object binaryParagraphs, Boolean overwrite, Int32 pacCodePage, Nullable`1 targetFrameRate, ICollection`1 multipleReplaceImportFiles, List`1 actions, Nullable`1 resolution, Boolean autoDetectLanguage, BatchConvertProgress progressCallback, String ebuHeaderFile, String ocrEngine, String preExt, Nullable`1 renumber, Nullable`1 adjustDurationMs) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/CommandLineConverter.cs:line 1157
   at seconv.CommandLineConverter.Convert(String[] arguments) in /Users/user/PycharmProjects/glixFunctions/pythonProject/subtitleedit-cli/src/se-cli/CommandLineConverter.cs:line 650

So I did a bit of search and convert thing , where I execute the script on the srt file, then removing blocks of rows until it was able to do the conversion. the row the conversion fails on is:

747
00:33:16,883 --> 00:33:20,061
אני רוצה שתסמוך עליי... אני צריך שתסמוך עליי, אוקיי?

which is not looking too weird

Compilation error

Hi, thank you very much for making this headless version. I'm trying to compile it as per instructions but I'm getting the error:

[tijuco@think-fedora subtitleedit-cli]$ ll
total 44
-rw-r--r-- 1 tijuco tijuco 35149 Sep 21 19:30 LICENSE
-rw-r--r-- 1 tijuco tijuco   380 Sep 21 19:30 README.md
-rw-r--r-- 1 tijuco tijuco  1326 Sep 21 19:30 SeCli.sln
drwxr-xr-x 1 tijuco tijuco    12 Sep 21 19:30 src
[tijuco@think-fedora subtitleedit-cli]$ dotnet build SeCli.csproj
Microsoft (R) Build Engine version 17.0.0+c9eb9dd64 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: SeCli.csproj
[tijuco@think-fedora subtitleedit-cli]$ 

OS: Fedora release 36 (Thirty Six)

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.