Coder Social home page Coder Social logo

myaamori / subkt Goto Github PK

View Code? Open in Web Editor NEW
48.0 48.0 5.0 2.45 MB

SubKt is a highly configurable toolkit for fansubbing automation written in Kotlin for Gradle. Documentation can be found at https://github.com/Myaamori/SubKt/blob/master/docs/subkt/index.md

License: GNU Lesser General Public License v3.0

Kotlin 100.00%

subkt's People

Contributors

myaamori 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

subkt's Issues

Mux task hangs when mkvmerge emits non-fatal warnings

One such example is if the file contains negative duration lines.

In these circumstances, mkvmerge (typically) carries on with the mux, but emits warnings to stderr and exits with the return code 1. From the docs:

  1. Exit codes
    mkvmerge(1) exits with one of three exit codes:
  • 0 -- This exit code means that muxing has completed successfully.
  • 1 -- In this case mkvmerge(1) has output at least one warning, but muxing did continue. A warning is prefixed with the text 'Warning:'. Depending on the issues involved the resulting file might be ok or not. The user is urged to check both the warning and the resulting file.
  • 2 -- This exit code is used after an error occurred. mkvmerge(1) aborts right after outputting the error message. Error messages range from wrong command line arguments over read/write errors to broken files.

However, SubKt seems to just hang on the mux task without outputting any files, nor anything to stdout:
image

Various doc/example updates

  • Incorrect syntax for sync times in the example file
  • Should prefer sync lines instead
  • Include example of fromIfPresent
  • More explicit documentation of the JDK setup
  • Detailed step-by-step tutorial going through the example build script

No support for TTC files and doesn't find fonts beginning with @-sign

Seems like SubKt doesn't support TTC files (TrueType collection) that have multiple fonts in one file.
It also doesn't find fonts starting with an @-sign (https://devblogs.microsoft.com/oldnewthing/20120719-00/?p=7093), though I was able to fix that with a short snippet of code: https://github.com/Sheigutn/SubKt/commit/526e24d22a47be684e235ff4dcfaeb5c98b81741
I'm not sure if you want to fix it exactly like that though, so I'm not submitting it as a pull request (yet).
Also, I really wanna thank you for this tool, it's very useful! :)

List lines as ranges in font validator

For instance, the following:

warning: font 'Mercurius CT Std Medium' not found on line(s): 6539 6540 6541 6542 6543 6545 6546 6547 6548 6550 [...]

might print out something like

warning: font 'Mercurius CT Std Medium' not found on line(s): 6539-6543 6545-6548 6550-6554 [...]

Random 1-frame offsets with `syncTargetLine` and `syncSourceLine`

I'm syncing an OP and an ED to an episode using subkt. However, using syncTargetLine and syncSourceLine, some lines appear to be randomly offset by 1 frame (both positive and negative). This issue persists even when doing a 0-frame shift, and happens on both regular lines and typesetting. The offsets are easily discernible in both Aegisub (Daydream Cafe 9213, release build) and mpv (0.33.0-217-gf049acfd43, shinchiro's build).

vlcsnap-2021-08-10-01h51m12s

Below is our current subkt setup and relevant subtitle files. Video and other missing files can be found you-know-where, and you can ask @rcombs for repo access if that helps.
Jahy.zip

Raise fatal font errors in Mux task in log output

When a font isn't found (fatal error), it should actually indicate that it is an error in the log output, rather than "warning". That should make it easier for the user to identify which fonts are causing issues. In a case where lots of fonts are being used, this can save significant time.

Validating fonts for Maid Dragon S2 - 04 [TV Final].ass...
warning: font 'KBPlanetEarth' not found on line(s): 8795 8799 8802 8805 8808 8811 8814 8817 8818 8821
warning: faux bold used for font AltonaBold (requested weight 400, got 5) on line(s): 4871 4872 4873 4874 4875 4888 4889 4890 
.............

> Task :mux.04.TV FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':mux.04.TV'.
> one or more fatal font-related issues encountered

should respect whatever settings are specified with the following, if not default:

onMissingGlyphs(ErrorMode.WARN)
onMissingFonts(ErrorMode.FAIL)

Torrent filename from nyaa gets cut after comma

Example:

Name of the show: Tantei wa Mou, Shindeiru.
Torrent filename is: Tantei wa Mou, Shindeiru. - 01 [1080p].torrent

After doing the nyaa.01 task when downloading the uploaded torrent from nyaa:
Torrent filename: Tantei wa Mou

Predicate function for MergeSpecification.incrementLayer

Sometimes, it's desirable to be able to only increment a merge specification's lines' layers if they satisfy certain criteria. For instance, if chapter markers are placed in the dialogue file as comments, you might not want to increment their layers along with the actual dialogue.

To achieve this, you currently need something like this:

val dialogue by task<ASS> {
	from(get("dialogue"))
	ass {
		for (line in events.lines) {
			if (!line.comment) {
				line.layer += 100
			}
		}
	}
}

merge {
	from(dialogue.item())
	// ...
}

I propose adding an argument of type (Line) -> Boolean, with a default value of { true } or whatever, to describe the conditions under which lines should be incremented.
With this change, the above example could be simplified to:

merge {
	from(get("dialogue")) {
		incrementLayer(100, { !it.comment })
	}
	// ...
}

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.