Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
SubtitlesConfiguration provides configuration options necessary
to extract subtitles.
type SubtitlesInformation ¶
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