api

package module
v0.4.23 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 19 Imported by: 9

README

go-api-client

Implementation of a client for the Livepeer API written in Go

Documentation

Index

Constants

View Source
const (
	SHORT    = 4
	DEBUG    = 5
	VERBOSE  = 6
	VVERBOSE = 7
	INSANE   = 12
	INSANE2  = 14
)
View Source
const (
	ProdServer = "livepeer.com"

	RecordingStatusWaiting = "waiting"
	RecordingStatusReady   = "ready"
)

Variables

View Source
var (
	// ErrNotExists returned if receives a 404 error from the API
	ErrNotExists error = &HTTPStatusError{404, "not exists"}
	// ErrRateLimited returned if receives a 429 error from the API
	ErrRateLimited error = &HTTPStatusError{429, "rate limited"}
)
View Source
var StandardProfiles = []Profile{
	{
		Name:    "240p0",
		Fps:     0,
		Bitrate: 250000,
		Width:   426,
		Height:  240,
		Gop:     "2.0",
	},
	{
		Name:    "360p0",
		Fps:     0,
		Bitrate: 800000,
		Width:   640,
		Height:  360,
		Gop:     "2.0",
	},
	{
		Name:    "480p0",
		Fps:     0,
		Bitrate: 1600000,
		Width:   854,
		Height:  480,
		Gop:     "2.0",
	},
	{
		Name:    "720p0",
		Fps:     0,
		Bitrate: 3000000,
		Width:   1280,
		Height:  720,
		Gop:     "2.0",
	},
}

Functions

func GeolocateAPIServer

func GeolocateAPIServer() (string, error)

GeolocateAPIServer calls geolocation API endpoint to find the closest server.

func MustGeolocateAPIServer

func MustGeolocateAPIServer() string

Types

type Asset

type Asset struct {
	ID            string      `json:"id"`
	Deleted       bool        `json:"deleted,omitempty"`
	PlaybackID    string      `json:"playbackId"`
	UserID        string      `json:"userId"`
	CreatedAt     int64       `json:"createdAt"`
	SourceAssetID string      `json:"sourceAssetId,omitempty"`
	ObjectStoreID string      `json:"objectStoreId"`
	DownloadURL   string      `json:"downloadUrl"`
	PlaybackURL   string      `json:"playbackUrl"`
	StaticMp4     bool        `json:"staticMp4,omitempty"`
	Source        AssetSource `json:"source"`
	Status        AssetStatus `json:"status"`
	AssetSpec
	SourcePlaybackReady bool       `json:"sourcePlaybackReady"`
	CreatorID           *CreatorID `json:"creatorId,omitempty"`
	ProjectID           string     `json:"projectId,omitempty"`
}

type AssetFile added in v0.4.0

type AssetFile struct {
	Type string        `json:"type"`
	Path string        `json:"path"`
	Spec AssetFileSpec `json:"spec,omitempty"`
}

type AssetFileSpec added in v0.4.3

type AssetFileSpec struct {
	Size    int64 `json:"size,omitempty"`
	Width   int64 `json:"width,omitempty"`
	Height  int64 `json:"height,omitempty"`
	Bitrate int64 `json:"bitrate,omitempty"`
}

type AssetHash

type AssetHash struct {
	Hash      string `json:"hash"`
	Algorithm string `json:"algorithm"`
}

type AssetIPFS added in v0.3.0

type AssetIPFS struct {
	IPFSFileInfo
	NFTMetadata *IPFSFileInfo `json:"nftMetadata,omitempty"`
	Spec        *struct {
		NFTMetadataTemplate `json:"nftMetadataTemplate,omitempty"`
		NFTMetadata         map[string]interface{} `json:"nftMetadata,omitempty"`
	} `json:"spec"`
}

type AssetSource added in v0.4.7

type AssetSource struct {
	Type string `json:"type,omitempty"`
}

type AssetSpec

type AssetSpec struct {
	Name                string          `json:"name,omitempty"`
	Type                string          `json:"type"`
	Size                uint64          `json:"size"`
	Hash                []AssetHash     `json:"hash"`
	Files               []AssetFile     `json:"files"`
	VideoSpec           *AssetVideoSpec `json:"videoSpec,omitempty"`
	Storage             *AssetStorage   `json:"storage,omitempty"`
	PlaybackRecordingID string          `json:"playbackRecordingId,omitempty"`
}

type AssetStatus added in v0.2.3

type AssetStatus struct {
	Phase        string `json:"phase"`
	UpdatedAt    int64  `json:"updatedAt,omitempty"`
	ErrorMessage string `json:"errorMessage,omitempty"`
}

type AssetStorage added in v0.3.0

type AssetStorage struct {
	IPFS   *AssetIPFS `json:"ipfs,omitempty"`
	Status struct {
		Phase        string            `json:"phase"`
		ErrorMessage string            `json:"errorMessage,omitempty"`
		Tasks        map[string]string `json:"tasks"`
	} `json:"status,omitempty"`
}

type AssetTrack

type AssetTrack struct {
	Type        string  `json:"type"`
	Codec       string  `json:"codec"`
	StartTime   float64 `json:"startTime,omitempty"`
	DurationSec float64 `json:"duration,omitempty"`
	Bitrate     float64 `json:"bitrate,omitempty"`
	// video track fields
	Width       int     `json:"width,omitempty"`
	Height      int     `json:"height,omitempty"`
	PixelFormat string  `json:"pixelFormat,omitempty"`
	FPS         float64 `json:"fps,omitempty"`
	// auido track fields
	Channels   int `json:"channels,omitempty"`
	SampleRate int `json:"sampleRate,omitempty"`
	BitDepth   int `json:"bitDepth,omitempty"`
}

type AssetVideoSpec

type AssetVideoSpec struct {
	Format      string        `json:"format"`
	DurationSec float64       `json:"duration"`
	Bitrate     float64       `json:"bitrate,omitempty"`
	Tracks      []*AssetTrack `json:"tracks"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

API object incapsulating Livepeer's hosted API

func NewAPIClient

func NewAPIClient(opts ClientOptions) *Client

NewAPIClient creates new Livepeer API object with a full configuration.

func NewAPIClientGeolocated

func NewAPIClientGeolocated(opts ClientOptions) (*Client, string)

NewAPIClientGeolocated creates a new Livepeer API object calling the geolocation endpoint if no server is provided (by default, server is production instead)

func (*Client) Broadcasters

func (lapi *Client) Broadcasters() ([]string, error)

Broadcasters returns list of hostnames of broadcasters to use

func (*Client) CreateStream

func (lapi *Client) CreateStream(csr CreateStreamReq) (*Stream, error)

CreateStream creates stream with specified name and profiles

func (*Client) CreateStreamEx

func (lapi *Client) CreateStreamEx(name string, record bool, presets []string, profiles ...Profile) (*Stream, error)

CreateStreamEx creates stream with specified name and profiles

func (*Client) DeactivateMany

func (lapi *Client) DeactivateMany(ids []string) (int, error)

DeactivateMany sets many streams isActive field to false

func (*Client) DefaultPresets

func (lapi *Client) DefaultPresets() []string

DefaultPresets returns default presets

func (*Client) DeleteAsset added in v0.2.5

func (lapi *Client) DeleteAsset(id string) error

func (*Client) DeleteStream

func (lapi *Client) DeleteStream(id string) error

DeleteStream deletes stream

func (*Client) ExportAsset added in v0.2.3

func (lapi *Client) ExportAsset(assetId string) (*Task, error)

func (*Client) FlagAssetAsDeleted added in v0.4.23

func (lapi *Client) FlagAssetAsDeleted(assetID string) error

func (*Client) GetAsset

func (lapi *Client) GetAsset(id string, strongConsistency bool) (*Asset, error)

func (*Client) GetAssetByPlaybackID added in v0.2.5

func (lapi *Client) GetAssetByPlaybackID(pid string, includeDeleted bool) (*Asset, error)

func (*Client) GetDeletingAssets added in v0.4.23

func (lapi *Client) GetDeletingAssets() ([]*Asset, error)

func (*Client) GetMultistreamTarget

func (lapi *Client) GetMultistreamTarget(id string) (*MultistreamTarget, error)

func (*Client) GetObjectStore

func (lapi *Client) GetObjectStore(id string) (*ObjectStore, error)

func (*Client) GetPlaybackInfo added in v0.4.3

func (lapi *Client) GetPlaybackInfo(pid string) (*PlaybackInfo, error)

func (*Client) GetServer

func (lapi *Client) GetServer() string

GetServer returns chosen server

func (*Client) GetSessions

func (lapi *Client) GetSessions(id string, forceUrl bool) ([]UserSession, error)

GetSessions gets user's sessions for the stream by id

func (*Client) GetSessionsNew

func (lapi *Client) GetSessionsNew(id string, forceUrl bool) ([]UserSession, error)

func (*Client) GetStream

func (lapi *Client) GetStream(id string, forceRecordingUrl bool) (*Stream, error)

GetStream gets stream by id

func (*Client) GetStreamByKey

func (lapi *Client) GetStreamByKey(key string) (*Stream, error)

GetStreamByKey gets stream by streamKey

func (*Client) GetStreamByPlaybackID

func (lapi *Client) GetStreamByPlaybackID(playbackID string) (*Stream, error)

GetStreamByPlaybackID gets stream by playbackID

func (*Client) GetTask

func (lapi *Client) GetTask(id string, strongConsistency bool) (*Task, error)

func (*Client) Heartbeat added in v0.4.12

func (lapi *Client) Heartbeat(id string) error

Heartbeat updates the stream session

func (*Client) Ingest

func (lapi *Client) Ingest(all bool) ([]Ingest, error)

Ingest returns ingest object

func (*Client) ListAssets added in v0.2.3

func (lapi *Client) ListAssets(opts ListOptions) ([]*Asset, string, error)

func (*Client) LockPull added in v0.4.19

func (lapi *Client) LockPull(id string, leaseTimeout time.Duration, host string) error

LockPull locks the stream pull

func (*Client) PushSegment

func (lapi *Client) PushSegment(sid string, seqNo int, dur time.Duration, segData []byte, resolution string) ([][]byte, error)

PushSegment pushes a segment with retries

func (*Client) RequestUpload added in v0.3.0

func (lapi *Client) RequestUpload(name, catalystStrategy string) (*UploadUrls, error)

func (*Client) ResumableUpload added in v0.3.0

func (lapi *Client) ResumableUpload(url string, file *os.File) error

Temporary function while waiting for go-api-client to get fixed

func (*Client) SetActive

func (lapi *Client) SetActive(id string, active bool, startedAt time.Time) (ok bool, err error)

SetActive set isActive

func (*Client) TranscodeAsset added in v0.2.3

func (lapi *Client) TranscodeAsset(assetId string, name string, profile Profile) (*Asset, *Task, error)

func (*Client) TranscodeFile added in v0.4.2

func (lapi *Client) TranscodeFile(tfr TranscodeFileReq) (*Task, error)

TranscodeFile transcodes a file

func (*Client) UpdateTaskStatus

func (lapi *Client) UpdateTaskStatus(id string, phase TaskPhase, progress float64, step string) error

func (*Client) UploadAsset added in v0.3.0

func (lapi *Client) UploadAsset(ctx context.Context, url string, file io.ReadSeeker) error

func (*Client) UploadViaURL added in v0.4.1

func (lapi *Client) UploadViaURL(url, name, catalystStrategy string) (*Asset, *Task, error)

type ClientOptions

type ClientOptions struct {
	Server      string
	AccessToken string
	UserAgent   string
	Timeout     time.Duration
	Presets     []string
	Metrics     metrics.APIRecorder
}

Object with all options given to Livepeer API

type ClipTaskParams added in v0.4.10

type ClipTaskParams struct {
	URL                      string `json:"url"`
	CatalystPipelineStrategy string `json:"catalystPipelineStrategy,omitempty"`
	ClipStrategy             struct {
		StartTime  int64  `json:"startTime"`
		EndTime    int64  `json:"endTime"`
		PlaybackId string `json:"playbackId"`
	}
	InputSessionID      string `json:"sessionId"`
	InputID             string `json:"inputId"`
	SourceObjectStoreID string `json:"sourceObjectStoreId"`
}

type CreateStreamReq added in v0.2.0

type CreateStreamReq struct {
	Name      string `json:"name"`
	ParentID  string `json:"parentId,omitempty"`
	CreatorID string `json:"creatorId,omitempty"`

	// one of: P720p60fps16x9, P720p30fps16x9, P720p30fps4x3, P576p30fps16x9, P360p30fps16x9, P360p30fps4x3, P240p30fps16x9, P240p30fps4x3, P144p30fps16x9
	// this is deprecated and Profiles should be used instead.
	Presets        []string        `json:"presets,omitempty"`
	Profiles       []Profile       `json:"profiles,omitempty"`
	Record         bool            `json:"record,omitempty"`
	PlaybackPolicy *PlaybackPolicy `json:"playbackPolicy,omitempty"`

	RecordObjectStoreId string `json:"recordObjectStoreId,omitempty"`
	ObjectStoreId       string `json:"objectStoreId,omitempty"`
}

type CreatorID added in v0.4.18

type CreatorID struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

type ExportAssetResp added in v0.2.3

type ExportAssetResp struct {
	Task Task `json:"task"`
}

type ExportCustomParams added in v0.4.8

type ExportCustomParams struct {
	URL     string            `json:"url"`
	Method  string            `json:"method,omitempty"`
	Headers map[string]string `json:"headers,omitempty"`
}

type ExportDataTaskParams added in v0.4.8

type ExportDataTaskParams struct {
	Content json.RawMessage     `json:"content"`
	Type    string              `json:"type"`
	ID      string              `json:"id"`
	Custom  *ExportCustomParams `json:"custom,omitempty"`
	IPFS    *ExportIPFSParams   `json:"ipfs,omitempty"`
}

type ExportIPFSParams added in v0.4.8

type ExportIPFSParams struct {
	Pinata *struct {
		JWT       string `json:"jwt,omitempty"`
		APIKey    string `json:"apiKey,omitempty"`
		APISecret string `json:"apiSecret,omitempty"`
	} `json:"pinata,omitempty"`
	NFTMetadataTemplate `json:"nftMetadataTemplate,omitempty"`
	NFTMetadata         map[string]interface{} `json:"nftMetadata,omitempty"`
}

type ExportTaskParams

type ExportTaskParams struct {
	Custom *ExportCustomParams `json:"custom,omitempty"`
	IPFS   *ExportIPFSParams   `json:"ipfs,omitempty"`
}

type HRN added in v0.4.3

type HRN string
const (
	HRN_HLS HRN = "HLS (TS)"
)

type HTTPStatusError added in v0.4.2

type HTTPStatusError struct {
	StatusCode int
	Message    string
}

func (*HTTPStatusError) Error added in v0.4.2

func (e *HTTPStatusError) Error() string

type IPFS added in v0.2.3

type IPFS struct {
	Pinata      *Pinata     `json:"pinata,omitempty"`
	NFTMetadata interface{} `json:"nftMetadata,omitempty"`
}

type IPFSFileInfo added in v0.3.0

type IPFSFileInfo struct {
	CID        string `json:"cid"`
	GatewayUrl string `json:"gatewayUrl,omitempty"`
	Url        string `json:"url,omitempty"`
}

type Ingest

type Ingest struct {
	Base     string `json:"base,omitempty"`
	Playback string `json:"playback,omitempty"`
	Ingest   string `json:"ingest,omitempty"`
}

Ingest object

type ListOptions added in v0.2.5

type ListOptions struct {
	Limit                                     int
	Cursor                                    string
	AllUsers, IncludeDeleted, IncludeDeleting bool
	Filters                                   map[string]interface{}
	Order                                     map[string]bool
}

type MultistreamTarget

type MultistreamTarget struct {
	ID        string `json:"id,omitempty"`
	URL       string `json:"url,omitempty"`
	Name      string `json:"name,omitempty"`
	UserID    string `json:"userId,omitempty"`
	Disabled  bool   `json:"disabled,omitempty"`
	CreatedAt int64  `json:"createdAt,omitempty"`
}

type MultistreamTargetRef

type MultistreamTargetRef struct {
	Profile   string `json:"profile,omitempty"`
	VideoOnly bool   `json:"videoOnly,omitempty"`
	ID        string `json:"id,omitempty"`
}

type NFTMetadataTemplate added in v0.1.5

type NFTMetadataTemplate string
const (
	NFTMetadataTemplatePlayer NFTMetadataTemplate = "player" // default
	NFTMetadataTemplateFile   NFTMetadataTemplate = "file"
)

type ObjectStore

type ObjectStore struct {
	ID        string `json:"id"`
	UserId    string `json:"userId"`
	CreatedAt int64  `json:"createdAt"`
	URL       string `json:"url"`
	Name      string `json:"name,omitempty"`
	PublicURL string `json:"publicUrl,omitempty"`
	Disabled  bool   `json:"disabled"`
}

type Pinata added in v0.2.3

type Pinata struct {
	JWT       string `json:"jwt,omitempty"`
	APIKey    string `json:"apiKey,omitempty"`
	APISecret string `json:"apiSecret,omitempty"`
}

type PlaybackInfo added in v0.4.3

type PlaybackInfo struct {
	Type PlaybackInfoType `json:"type"`
	Meta struct {
		Live   *int                 `json:"live,omitempty"`
		Source []PlaybackInfoSource `json:"source"`
	} `json:"meta"`
}

type PlaybackInfoSource added in v0.4.3

type PlaybackInfoSource struct {
	Hrn  HRN                    `json:"hrn"`
	Type PlaybackInfoSourceType `json:"type"`
	Url  string                 `json:"url"`
}

type PlaybackInfoSourceType added in v0.4.3

type PlaybackInfoSourceType string
const (
	PlaybackInfoSourceTypeHLS PlaybackInfoSourceType = "html5/application/vnd.apple.mpegurl"
)

type PlaybackInfoType added in v0.4.3

type PlaybackInfoType string
const (
	PlaybackInfoTypeLive      PlaybackInfoType = "live"
	PlaybackInfoTypeVod       PlaybackInfoType = "vod"
	PlaybackInfoTypeRecording PlaybackInfoType = "recording"
)

type PlaybackPolicy added in v0.4.14

type PlaybackPolicy struct {
	// one of: public, jwt, webhook
	Type           string                 `json:"type"`
	WebhookID      string                 `json:"webhookId,omitempty"`
	WebhookContext map[string]interface{} `json:"webhookContext,omitempty"`
}

type Profile

type Profile struct {
	Name    string `json:"name,omitempty"`
	Width   int    `json:"width,omitempty"`
	Height  int    `json:"height,omitempty"`
	Bitrate int    `json:"bitrate,omitempty"`
	Quality int    `json:"quality,omitempty"`
	Fps     int    `json:"fps"`
	FpsDen  int    `json:"fpsDen,omitempty"`
	Gop     string `json:"gop,omitempty"`
	Profile string `json:"profile,omitempty"` // enum: - H264Baseline - H264Main - H264High - H264ConstrainedHigh
	Encoder string `json:"encoder,omitempty"` // enum: - h264, h265, vp8, vp9
}

Profile transcoding profile

type Stream added in v0.2.0

type Stream struct {
	ID                         string    `json:"id,omitempty"`
	Name                       string    `json:"name,omitempty"`
	Presets                    []string  `json:"presets,omitempty"`
	Kind                       string    `json:"kind,omitempty"`
	UserID                     string    `json:"userId,omitempty"`
	StreamKey                  string    `json:"streamKey,omitempty"`
	PlaybackID                 string    `json:"playbackId,omitempty"`
	ParentID                   string    `json:"parentId,omitempty"`
	CreatedAt                  int64     `json:"createdAt,omitempty"`
	LastSeen                   int64     `json:"lastSeen,omitempty"`
	IsActive                   bool      `json:"isActive,omitempty"`
	SourceSegments             int64     `json:"sourceSegments,omitempty"`
	TranscodedSegments         int64     `json:"transcodedSegments,omitempty"`
	SourceSegmentsDuration     float64   `json:"sourceSegmentsDuration,omitempty"`
	TranscodedSegmentsDuration float64   `json:"transcodedSegmentsDuration,omitempty"`
	Deleted                    bool      `json:"deleted,omitempty"`
	Suspended                  bool      `json:"suspended,omitempty"`
	Record                     bool      `json:"record"`
	Profiles                   []Profile `json:"profiles,omitempty"`
	Multistream                struct {
		Targets []MultistreamTargetRef `json:"targets,omitempty"`
	} `json:"multistream"`

	// These can be present on parent stream objects if they are used to stream
	// directly to broadcasters (i.e. not using the streamKey through RTMP)
	RecordingStatus string `json:"recordingStatus,omitempty"` // ready, waiting
	RecordingURL    string `json:"recordingUrl,omitempty"`
	Mp4Url          string `json:"mp4Url,omitempty"`

	Pull       *StreamPull `json:"pull,omitempty"`
	PullRegion string      `json:"pullRegion,omitempty"`
	CreatorID  *CreatorID  `json:"creatorID,omitempty"`
	ProjectID  string      `json:"projectId,omitempty"`
}

Stream object as returned by the API

type StreamPull added in v0.4.15

type StreamPull struct {
	Source   string            `json:"source"`
	Headers  map[string]string `json:"headers,omitempty"`
	Location *struct {
		Lat float64 `json:"lat"`
		Lon float64 `json:"lon"`
	} `json:"location,omitempty"`
}

type Task

type Task struct {
	ID            string `json:"id"`
	UserID        string `json:"userId"`
	CreatedAt     int64  `json:"createdAt"`
	InputAssetID  string `json:"inputAssetId,omitempty"`
	OutputAssetID string `json:"outputAssetId,omitempty"`
	Type          string `json:"type"`
	Params        struct {
		Upload        *UploadTaskParams        `json:"upload"`
		Import        *UploadTaskParams        `json:"import"`
		Export        *ExportTaskParams        `json:"export"`
		ExportData    *ExportDataTaskParams    `json:"exportData"`
		Transcode     *TranscodeTaskParams     `json:"transcode"`
		TranscodeFile *TranscodeFileTaskParams `json:"transcode-file"`
		Clip          *ClipTaskParams          `json:"clip"`
	} `json:"params"`
	Output *struct {
		Export *struct {
			IPFS *struct {
				VideoFileCid          string `json:"videoFileCid"`
				NftMetadataCid        string `json:"nftMetadataCid"`
				VideoFileUrl          string `json:"videoFileUrl"`
				VideoFileGatewayUrl   string `json:"videoFileGatewayUrl"`
				NftMetadataUrl        string `json:"nftMetadataUrl"`
				NftMetadataGatewayUrl string `json:"nftMetadataGatewayUrl"`
			} `json:"ipfs"`
		} `json:"export"`
		TranscodeFile *struct {
			BaseUrl string                        `json:"baseUrl"`
			Hls     TranscodeFileTaskOutputPath   `json:"hls"`
			Mp4     []TranscodeFileTaskOutputPath `json:"mp4"`
		} `json:"transcodeFile"`
	} `json:"output"`
	Status TaskStatus `json:"status"`
}

type TaskAndAsset added in v0.2.3

type TaskAndAsset struct {
	Asset Asset `json:"asset"`
	Task  Task  `json:"task"`
}

type TaskOnlyId added in v0.3.0

type TaskOnlyId struct {
	ID string `json:"id"`
}

type TaskPhase added in v0.3.0

type TaskPhase string
const (
	TaskPhasePending   TaskPhase = "pending"
	TaskPhaseWaiting   TaskPhase = "waiting"
	TaskPhaseRunning   TaskPhase = "running"
	TaskPhaseFailed    TaskPhase = "failed"
	TaskPhaseCompleted TaskPhase = "completed"
)

type TaskStatus

type TaskStatus struct {
	Phase        TaskPhase `json:"phase"`
	Progress     float64   `json:"progress"`
	Step         string    `json:"step,omitempty"`
	Retries      int       `json:"retries,omitempty"`
	UpdatedAt    int64     `json:"updatedAt,omitempty"`
	ErrorMessage string    `json:"errorMessage,omitempty"`
}

type TranscodeFileReq added in v0.4.2

type TranscodeFileReq struct {
	Input   TranscodeFileReqInput   `json:"input,omitempty"`
	Storage TranscodeFileReqStorage `json:"storage,omitempty"`
	Outputs TranscodeFileReqOutputs `json:"outputs,omitempty"`
}

type TranscodeFileReqCredentials added in v0.4.2

type TranscodeFileReqCredentials struct {
	AccessKeyId     string `json:"accessKeyId,omitempty"`
	SecretAccessKey string `json:"secretAccessKey,omitempty"`
	Proof           string `json:"proof,omitempty"`
}

type TranscodeFileReqInput added in v0.4.2

type TranscodeFileReqInput struct {
	Url         string                       `json:"url,omitempty"`
	Type        string                       `json:"type,omitempty"`
	Endpoint    string                       `json:"endpoint,omitempty"`
	Credentials *TranscodeFileReqCredentials `json:"credentials,omitempty"`
	Bucket      string                       `json:"bucket,omitempty"`
	Path        string                       `json:"path,omitempty"`
}

type TranscodeFileReqOutput added in v0.4.6

type TranscodeFileReqOutput struct {
	Path string `json:"path,omitempty"`
}

type TranscodeFileReqOutputs added in v0.4.2

type TranscodeFileReqOutputs struct {
	Hls  TranscodeFileReqOutput `json:"hls,omitempty"`
	Mp4  TranscodeFileReqOutput `json:"mp4,omitempty"`
	FMp4 TranscodeFileReqOutput `json:"fmp4,omitempty"`
}

type TranscodeFileReqStorage added in v0.4.2

type TranscodeFileReqStorage struct {
	Type        string                       `json:"type,omitempty"`
	Endpoint    string                       `json:"endpoint,omitempty"`
	Credentials *TranscodeFileReqCredentials `json:"credentials,omitempty"`
	Bucket      string                       `json:"bucket,omitempty"`
}

type TranscodeFileTaskOutputPath added in v0.4.3

type TranscodeFileTaskOutputPath struct {
	Path string `json:"path,omitempty"`
}

type TranscodeFileTaskParams added in v0.4.2

type TranscodeFileTaskParams struct {
	Input struct {
		URL string `json:"url"`
	} `json:"input"`
	Storage struct {
		URL string `json:"url"`
	} `json:"storage"`
	Outputs struct {
		HLS struct {
			Path string `json:"path"`
		} `json:"hls"`
		MP4 struct {
			Path string `json:"path"`
		} `json:"mp4"`
		FMP4 struct {
			Path string `json:"path"`
		} `json:"fmp4"`
	} `json:"outputs"`
	Profiles                 []Profile `json:"profiles,omitempty"`
	CatalystPipelineStrategy string    `json:"catalystPipelineStrategy,omitempty"`
	TargetSegmentSizeSecs    int64     `json:"targetSegmentSizeSecs,omitempty"`
	C2PA                     bool      `json:"c2pa,omitempty"`
}

type TranscodeTaskParams

type TranscodeTaskParams struct {
	Profile Profile `json:"profile,omitempty"`
}

type UploadTaskParams added in v0.3.0

type UploadTaskParams struct {
	URL        string `json:"url,omitempty"`
	Encryption struct {
		EncryptedKey string `json:"encryptedKey,omitempty"`
		Key          string `json:"key,omitempty"`
		Algorithm    string `json:"algorithm,omitempty"`
	} `json:"encryption,omitempty"`
	RecordedSessionID        string    `json:"recordedSessionId,omitempty"`
	UploadedObjectKey        string    `json:"uploadedObjectKey,omitempty"`
	CatalystPipelineStrategy string    `json:"catalystPipelineStrategy,omitempty"`
	Thumbnails               bool      `json:"thumbnails"`
	C2PA                     bool      `json:"c2pa,omitempty"`
	Profiles                 []Profile `json:"profiles,omitempty"`
	TargetSegmentSizeSecs    int64     `json:"targetSegmentSizeSecs,omitempty"`
}

type UploadUrls added in v0.3.0

type UploadUrls struct {
	Url         string     `json:"url"`
	TusEndpoint string     `json:"tusEndpoint"`
	Asset       Asset      `json:"asset"`
	Task        TaskOnlyId `json:"task"`
}

type UserSession

type UserSession struct {
	Stream
}

UserSession user's sessions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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