asset

package
v0.0.0-...-f3c8a7e Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 33 Imported by: 2

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 IngestTimedMetadata

func IngestTimedMetadata(ctx context.Context, services externalServices, config config, params IngestTimedMetadataParams) error

Ingest timedmetadata from a JSON file based on the vxID

func MapContributionTypeFromContentType

func MapContributionTypeFromContentType(t common.ContentType) common.ContributionType

MapContributionTypeFromContentType guesses the contribution type based on the chapter type

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

type IngestTimedMetadataParams

type IngestTimedMetadataParams struct {
	VXID     string
	JSONPath string
}

type TimedMetadata

type TimedMetadata struct {
	ContentType    string   `json:"content_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"`
	ImageFilename  string   `json:"image"`
	Persons        []string `json:"persons"`
}

TimedMetadata is the JSON structure for the timed metadata JSON file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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