Documentation
¶
Index ¶
- Variables
- func GetLanguagesFromVideoElement(videoElement smil.Video) []string
- func Ingest(ctx context.Context, services externalServices, config config, ...) error
- func IngestTimedMetadata(ctx context.Context, services externalServices, config config, ...) error
- func MapContributionTypeFromContentType(t common.ContentType) common.ContributionType
- func SafeString(s string) string
- func UpdateIngestStatus(ctx context.Context, services externalServices, _ config, ...) error
- type IngestFileMeta
- type IngestJSONMeta
- type IngestTimedMetadataParams
- type TimedMetadata
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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"`
PrimaryMediaType string `json:"primary_media_type"`
}
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 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"`
Persons []string `json:"persons"`
}
TimedMetadata is the JSON structure for the timed metadata JSON file