core

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string)

Run runs the main app for cabiria-generate

func SaveASS

func SaveASS(prettyIntertitles PrettyIntertitles,
	subConfig SubtitlesConfiguration,
	videoConfig VideoConfiguration,
	videoInfo VideoInformation) error

SaveASS takes a representation of "pretty" subtitles and writes them to disk,

in ASS format.

Types

type ASSConfiguration

type ASSConfiguration struct {
	// contains filtered or unexported fields
}

ASSConfiguration is the config necessary to generate and save an ASS file

func (*ASSConfiguration) VideoHeight

func (ac *ASSConfiguration) VideoHeight() int

VideoHeight is the height of the video

func (*ASSConfiguration) VideoPath

func (ac *ASSConfiguration) VideoPath() string

VideoPath is the path to the input video

func (*ASSConfiguration) VideoWidth

func (ac *ASSConfiguration) VideoWidth() int

VideoWidth is the width of the video

type PrettyConfiguration

type PrettyConfiguration interface {
	FrameOutputDirectory() string
	FontName() string
	FontSize() uint
}

PrettyConfiguration provides configuration options which are needed

to stylize subtitles

type PrettyIntertitles

type PrettyIntertitles struct {
	GlobalStyle style.Style
	Subtitles   []subtitle.Subtitle
}

PrettyIntertitles can be exported to ASS.

func GeneratePrettyIntertitles

func GeneratePrettyIntertitles(
	videoInfo VideoInformation,
	subInfo SubtitlesInformation,
	config PrettyConfiguration) (PrettyIntertitles, error)

GeneratePrettyIntertitles uses extracted video and subtitle information

to generate PrettyIntertitles.

type SubtitlesConfiguration

type SubtitlesConfiguration interface {
	SRTPath() string
	ASSPath() string
}

SubtitlesConfiguration provides configuration options necessary

to extract subtitles.

type SubtitlesInformation

type SubtitlesInformation struct {
	Subtitles []subtitle.Subtitle
}

SubtitlesInformation is a representation of the input subtitle,

with some post processing.

func ExtractSubtitlesInformation

func ExtractSubtitlesInformation(config SubtitlesConfiguration) (SubtitlesInformation, error)

ExtractSubtitlesInformation will read in a subtitle given by the configuration,

and provide relevant information about the subtitle as output.

type VideoConfiguration

type VideoConfiguration interface {
	VideoPath() string
	FrameOutputDirectory() string
	PredictorPath() string
	SmoothingClosingThreshold() uint
	SmoothingOpeningThreshold() uint
}

VideoConfiguration provides configuration options necessary to extract video information

type VideoInformation

type VideoInformation struct {
	VideoFPS         float64
	VideoWidth       int
	VideoHeight      int
	IntertitleRanges []intertitle.Range
}

VideoInformation provides relevant information about the video (including

the intertitles)

func ExtractVideoInformation

func ExtractVideoInformation(config VideoConfiguration) (VideoInformation, error)

ExtractVideoInformation reads relevant information from the input video

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL