transcoding

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: Apache-2.0 Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AudioChannel

type AudioChannel struct {
	TrackIdx   int
	ChannelIdx int
	Layout     string
}

AudioChannel describes and Audio Mix

type AudioDownmix

type AudioDownmix struct {
	SrcChannels  []AudioChannel
	DestChannels []AudioChannel
}

AudioDownmix holds source and output channels layouts for providers to handle downmixing

type AudioPreset

type AudioPreset struct {
	Codec         string `json:"codec,omitempty"`
	Bitrate       string `json:"bitrate,omitempty"`
	Normalization bool   `json:"normalization,omitempty"`

	DiscreteTracks bool `json:"discreteTracks,omitempty"`
}

AudioPreset defines the set of parameters for audio on a given preset

type CancelJobRequest

type CancelJobRequest struct {
	JobID JobID `json:"jobId"`
}

type CancelJobResponse

type CancelJobResponse struct{ JobStatus }

type Client

type Client interface {
	// Jobs
	CreateJob(ctx context.Context, job CreateJobRequest) (CreateJobResponse, error)
	DescribeJob(ctx context.Context, jobID JobID) (JobStatusResponse, error)
	CancelJob(ctx context.Context, jobID JobID) (CancelJobResponse, error)

	// Presets
	CreatePreset(ctx context.Context, preset CreatePresetRequest) (CreatePresetResponse, error)
	DeletePreset(ctx context.Context, name PresetName) (DeletePresetResponse, error)

	// Providers
	AllProviders(ctx context.Context) (ProviderNames, error)
	GetProvider(ctx context.Context, name ProviderName) (ProviderDescription, error)
}

Client holds video-transcoding-api configuration and exposes methods for interacting with the transcoding service

type ComputeClass

type ComputeClass = string

ComputeClass represents a group of resources with similar capability TODO(as): This is a type alias, we shouldn't be using it.

const (
	ComputeClassTranscodeDefault      ComputeClass = "transcodeDefault" // any default transcodes
	ComputeClassDolbyVisionTranscode  ComputeClass = "doViTranscode"    // Dolby Vision transcodes
	ComputeClassDolbyVisionPreprocess ComputeClass = "doViPreprocess"   // Dolby Vision pre-processing
)

type CreateJobRequest

type CreateJobRequest struct {
	Name       string `json:"name,omitempty"`
	Source     string `json:"source"`
	SourceInfo File   `json:"sourceInfo,omitempty"`

	// Splice is a request to cut the source before processing. It falls somewhere
	// between file metadata and a request by the user to operate on the source.
	// Not every provider currently supports this feature.
	Splice timecode.Splice `json:"splice,omitempty"`

	Provider          string                      `json:"provider"`
	ExecutionFeatures ExecutionFeatures           `json:"executionFeatures,omitempty"`
	ExecutionEnv      ExecutionEnvironment        `json:"executionEnv,omitempty"`
	StreamingParams   StreamingParams             `json:"streamingParams,omitempty"`
	SidecarAssets     map[SidecarAssetKind]string `json:"sidecarAssets,omitempty"`

	DestinationBasePath string      `json:"destinationBasePath,omitempty"`
	Outputs             []JobOutput `json:"outputs"`

	AudioDownmix            AudioDownmix `json:"audioDownmix"`
	ExplicitKeyframeOffsets []float64    `json:"explicitKeyframeOffsets,omitempty"`
	Labels                  []string     `json:"labels,omitempty"`
}

CreateJobRequest and similar data structures describe the requests and replies of the Job management endpoints.

type CreateJobResponse

type CreateJobResponse struct {
	JobID JobID `json:"jobId"`
}

type CreatePresetRequest

type CreatePresetRequest struct {
	Providers     []string      `json:"providers"`
	Preset        Preset        `json:"preset"`
	OutputOptions OutputOptions `json:"outputOptions"`
}

CreatePresetRequest represents the request body structure when creating a preset

type CreatePresetResponse

type CreatePresetResponse struct {
	Results   map[string]NewPresetSummary
	PresetMap string
}

CreatePresetResponse contains the results of requests to generate new presets

type DefaultClient

type DefaultClient struct {
	BaseURL *url.URL
	Client  *http.Client
}

func (*DefaultClient) AllProviders

func (c *DefaultClient) AllProviders(ctx context.Context) (ProviderNames, error)

AllProviders returns all configured providers

func (*DefaultClient) CancelJob

func (c *DefaultClient) CancelJob(ctx context.Context, jobID JobID) (CancelJobResponse, error)

CancelJob will stop the execution of work in given provider

func (*DefaultClient) CreateJob

CreateJob creates a new transcode job based on the request definition

func (*DefaultClient) CreatePreset

CreatePreset attempts to create a new preset based on the request definition

func (*DefaultClient) DeletePreset

func (c *DefaultClient) DeletePreset(ctx context.Context, name PresetName) (DeletePresetResponse, error)

DeletePreset removes the preset from all providers

func (*DefaultClient) DescribeJob

func (c *DefaultClient) DescribeJob(ctx context.Context, jobID JobID) (JobStatusResponse, error)

DescribeJob returns details about a single job

func (*DefaultClient) GetProvider

func (c *DefaultClient) GetProvider(ctx context.Context, name ProviderName) (ProviderDescription, error)

GetProvider returns information on a specific provider

type DeletePresetResponse

type DeletePresetResponse struct {
	Results   map[string]DeletePresetSummary `json:"results"`
	PresetMap string                         `json:"presetMap"`
}

DeletePresetResponse contains the results of requests to remove a preset

type DeletePresetSummary

type DeletePresetSummary struct {
	PresetID string `json:"presetId"`
	Error    string `json:"error,omitempty"`
}

DeletePresetSummary contains preset deletion results for a single provider

type DolbyVisionSettings

type DolbyVisionSettings struct {
	Enabled bool `json:"enabled" redis-hash:"enabled"`
}

DolbyVisionSettings defines a set of configurations for setting DolbyVision metadata

type ExecutionEnvironment

type ExecutionEnvironment struct {
	Cloud            string                  `json:"cloud"`
	Region           string                  `json:"region"`
	ComputeTags      map[ComputeClass]string `json:"computeTags,omitempty"`
	CredentialsAlias string                  `json:"credentialsAlias,omitempty"`
	InputAlias       string                  `json:"inputAlias,omitempty"`
	OutputAlias      string                  `json:"outputAlias,omitempty"`
}

ExecutionEnvironment contains configurations for the environment used while transcoding

type ExecutionFeatures

type ExecutionFeatures map[string]interface{}

ExecutionFeatures is a map whose key is a custom feature name and value is a json string representing the corresponding custom feature definition

type File

type File struct {
	Path      string        `json:"path"`
	Size      int64         `json:"fileSize"`
	Container string        `json:"container"`
	Duration  time.Duration `json:"duration,omitempty"`

	VideoCodec string   `json:"videoCodec,omitempty"`
	Width      int      `json:"width,omitempty"`
	Height     int      `json:"height,omitempty"`
	FrameRate  float64  `json:"frameRate,omitempty"`
	ScanType   ScanType `json:"scanType,omitempty"`
}

File is a media file. It replaces the following objects SourceInfo: Duration, Height, Width, Codec CreateJobSourceInfo: Height, Width, FrameRate, File Size, ScanType SourceInfo:

type HDR10Settings

type HDR10Settings struct {
	Enabled       bool   `json:"enabled"`
	MaxCLL        uint   `json:"maxCLL,omitempty"`
	MaxFALL       uint   `json:"maxFALL,omitempty"`
	MasterDisplay string `json:"masterDisplay,omitempty"`
}

HDR10Settings defines a set of configurations for defining HDR10 metadata

type Image

type Image struct {
	URL string `json:"url"`
}

Image defines the image overlay settings

type JobID

type JobID string

JobID is our job's unique identifier

type JobOutput

type JobOutput struct {
	FileName string     `json:"fileName"`
	Preset   PresetName `json:"preset"`
}

JobOutput defines config parameters for single output in a job

type JobStatus

type JobStatus struct {
	Progress      float64 `json:"progress"`
	Status        Status  `json:"status,omitempty"`
	StatusMessage string  `json:"statusMessage,omitempty"`

	ProviderJobID  string                 `json:"providerJobId,omitempty"`
	ProviderName   string                 `json:"providerName,omitempty"`
	ProviderStatus map[string]interface{} `json:"providerStatus,omitempty"`

	SourceInfo File `json:"sourceInfo,omitempty"`

	Output OutputFiles `json:"output"`
}

JobStatus is the representation of the status as the provider sees it.

type JobStatusResponse

type JobStatusResponse struct {
	JobStatus
}

JobStatusResponse contains the results of describe job request

type NewPresetSummary

type NewPresetSummary struct {
	PresetID string
	Error    string
}

NewPresetSummary contains preset creation results for a single provider

type OutputFiles

type OutputFiles struct {
	Destination string `json:"destination,omitempty"`
	Files       []File `json:"files,omitempty"`
}

OutputFiles represents information about a job's outputs

type OutputOptions

type OutputOptions struct {
	Extension string `json:"extension"`
}

OutputOptions is the set of options for the output file.

type Overlays

type Overlays struct {
	Images         []Image         `json:"images,omitempty"`
	TimecodeBurnin *TimecodeBurnin `json:"timecodeBurnin,omitempty"`
}

Overlays defines all the overlay settings for a Video preset

type Preset

type Preset struct {
	Name            PresetName  `json:"name,omitempty"`
	Description     string      `json:"description,omitempty"`
	SourceContainer string      `json:"sourceContainer,omitempty"`
	Container       string      `json:"container,omitempty"`
	RateControl     string      `json:"rateControl,omitempty"`
	TwoPass         bool        `json:"twoPass"`
	Video           VideoPreset `json:"video"`
	Audio           AudioPreset `json:"audio"`
}

Preset defines the set of parameters of a given preset

type PresetName

type PresetName string

PresetName is a custom string type with the name of the preset

type ProviderCapabilities

type ProviderCapabilities struct {
	InputFormats  []string `json:"input"`
	OutputFormats []string `json:"output"`
	Destinations  []string `json:"destinations"`
}

Capabilities describes the available features in the provider.

type ProviderDescription

type ProviderDescription struct {
	Name         string               `json:"name"`
	Capabilities ProviderCapabilities `json:"capabilities"`
	Health       ProviderHealth       `json:"health"`
	Enabled      bool                 `json:"enabled"`
}

Description fully describes a provider.

type ProviderHealth

type ProviderHealth struct {
	OK      bool   `json:"ok"`
	Message string `json:"message,omitempty"`
}

Health describes the current health status of the provider.

type ProviderName

type ProviderName string

ProviderName is a custom string type with the name of the provider

type ProviderNames

type ProviderNames []ProviderName

ProviderNames holds many ProviderName instances

type ScanType

type ScanType string

ScanType is a string that represents the scan type of the content.

const (
	ScanTypeUnknown     ScanType = "unknown"
	ScanTypeProgressive ScanType = "progressive"
	ScanTypeInterlaced  ScanType = "interlaced"
)

type SidecarAssetKind

type SidecarAssetKind = string

SidecarAssetKind is the type of sidecar asset being defined TODO(as): This is a type alias, we shouldn't be using it.

const SidecarAssetKindDolbyVisionMetadata SidecarAssetKind = "dolbyVisionMetadata"

SidecarAssetKindDolbyVisionMetadata defines the dolby vision dynamic metadata location

type Status

type Status string

Status is the status of a transcoding job.

type StreamingParams

type StreamingParams struct {
	SegmentDuration  uint   `json:"segmentDuration"`
	Protocol         string `json:"protocol"`
	PlaylistFileName string `json:"playlistFileName,omitempty"`
}

StreamingParams contains the configuration for media packaging

type TimecodeBurnin

type TimecodeBurnin struct {
	Enabled  bool   `json:"enabled"`
	FontSize int    `json:"fontSize,omitempty"`
	Position int    `json:"position,omitempty"`
	Prefix   string `json:"prefix,omitempty"`
}

TimecodeBurnin defines the timecode burnin settings

type VideoPreset

type VideoPreset struct {
	Profile             string              `json:"profile,omitempty"`
	ProfileLevel        string              `json:"profileLevel,omitempty"`
	Width               string              `json:"width,omitempty"`
	Height              string              `json:"height,omitempty"`
	Codec               string              `json:"codec,omitempty"`
	Bitrate             string              `json:"bitrate,omitempty"`
	GopSize             string              `json:"gopSize,omitempty"`
	GopUnit             string              `json:"gopUnit,omitempty"`
	GopMode             string              `json:"gopMode,omitempty"`
	InterlaceMode       string              `json:"interlaceMode,omitempty"`
	HDR10Settings       HDR10Settings       `json:"hdr10"`
	DolbyVisionSettings DolbyVisionSettings `json:"dolbyVision"`
	Overlays            *Overlays           `json:"overlays,omitempty"`

	// Crop contains offsets for top, bottom, left and right src cropping
	Crop video.Crop `json:"crop"`

	// Framerate contains individual integer elements of a fractional framerate
	// including both the numerator and its divisor
	Framerate video.Framerate `json:"framerate"`
}

VideoPreset defines the set of parameters for video on a given preset

Jump to

Keyboard shortcuts

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