asset

package
v0.0.0-...-8eba3d0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 32 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResourcesEmpty = merry.Sentinel("AWS assets list empty")
	ErrDuringCopy     = merry.Sentinel("error copying files on S3. See log for more details")
)

Sentinel errors

Functions

func GetLanguagesFromVideoElement

func GetLanguagesFromVideoElement(videoElement smil.Video) []string

GetLanguagesFromVideoElement formatted as per AWS: https://aws.amazon.com/blogs/media/smil-using-aws-elemental-mediapackage-vod/ For example: ```

<video name="example_1080.mp4" systemLanguage="eng,spa,fra" audioName="English,Spanish,French"/>

``` If systemLanguage param is not present the return will be an empty array

func Ingest

func Ingest(ctx context.Context, services externalServices, config config, event cloudevents.Event) error

Ingest asset from storage based on the prefix.

func SafeString

func SafeString(s string) string

SafeString takes an arbitrary string and returns a safe version.

The following actions are performed: * Remove/Replace invalid UTF8 * Spaces are trimmed * Everything is converted to UPPER CASE * characters in regexSafeStringReplace are replaced by _ * Everythin else except regexSafeStringChars is removed

func UpdateIngestStatus

func UpdateIngestStatus(ctx context.Context, services externalServices, _ config, event pubsub.MediaPackageInputNotification) error

UpdateIngestStatus parses the event and updates the status of an asset in the database

Types

type Chapter

type Chapter struct {
	ChapterType    string   `json:"chapter_type"`
	Timestamp      float64  `json:"timestamp"`
	Label          string   `json:"label"`
	Title          string   `json:"title"`
	Description    string   `json:"description"`
	SongCollection string   `json:"song_collection"`
	SongNumber     string   `json:"song_number"`
	Highlight      bool     `json:"highlight"`
	Persons        []string `json:"persons"`
}

Chapter contains data for a chapter

type IngestFileMeta

type IngestFileMeta struct {
	Mime             string `json:"mime"`
	Path             string `json:"path"`
	AudioLanguage    string `json:"audiolanguage"`
	SubtitleLanguage string `json:"subtitlelanguage"`
	Resolution       string `json:"resolution"`
}

IngestFileMeta is the JSON structure for the ingest JSON file

type IngestJSONMeta

type IngestJSONMeta struct {
	Duration    string `json:"duration"`
	DurationInS int64

	Title        string           `json:"title"`
	ID           string           `json:"id"`
	SmilFile     string           `json:"smil_file"`
	ChaptersFile string           `json:"chapters_file"`
	Files        []IngestFileMeta `json:"files"`
	BasePath     string           `json:"base_path"`
	Source       string           `json:"source"`
}

IngestJSONMeta is the JSON structure for the ingest JSON file

func (*IngestJSONMeta) CalculateDuration

func (a *IngestJSONMeta) CalculateDuration()

CalculateDuration calculates the asset duration and assigns it to the meta

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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