Documentation
¶
Overview ¶
Package embedded reads the subtitle tracks inside a video file and stores them as its instance's probe, and owns the embedded_subtitles section. It inspects local media and is not a provider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Codecs = []string{ codecSRT, codecASS, codecSSA, codecWebVTT, codecMovText, codecPGS, codecVobSub, codecDVBSub, codecTeletext, codecCEA608, codecTTML, } DefaultIgnored = []string{codecPGS, codecVobSub} // TextCodecs can serve as a sync reference; the image's ffmpeg decodes each. TextCodecs = []string{codecSRT, codecASS, codecSSA, codecWebVTT, codecMovText} )
Codecs is ignore_codecs' closed value set; DefaultIgnored is the section's default, the two picture formats.
var Schema = formschema.Schema{Fields: []formschema.Field{{ Key: fieldIgnoreCodecs, Label: "Ignored embedded formats", Kind: formschema.StringList, Enum: Codecs, Default: "[" + strings.Join(DefaultIgnored, ", ") + "]", Help: "Subtitle tracks inside a video in these formats do not count as subtitles it has, so subflux still downloads them.", }}}
Schema is the embedded_subtitles section's form.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config is the embedded_subtitles section. Its zero value ignores no format; ParseConfig of an absent section ignores DefaultIgnored.
func ParseConfig ¶
func ParseConfig(n *yaml.Node) (Config, []formschema.FieldError)
ParseConfig decodes the embedded_subtitles section, n being its node or nil when absent, reporting each error at embedded_subtitles.<key>.
type Prober ¶
type Prober struct {
// contains filtered or unexported fields
}
Prober probes videos with ffprobe from PATH and stores what it finds.
func (*Prober) Probe ¶
func (p *Prober) Probe(ctx context.Context, inst statedb.InstanceID, video *os.File) (statedb.VideoProbe, error)
Probe returns inst's probe of video, the file mediawrite.Writer.OpenVideo opened, which the caller closes after Probe returns. ffprobe runs only when video's size or modification time differs from the stored probe's stamp, and its result is stored with PutEmbedded. A Stat failure stores nothing; a failed ffprobe stores a probe with no tracks and a zero stamp, so the inventory completes and the next Probe runs ffprobe again, and returns the failure.