Documentation
¶
Index ¶
- type Media
- func (m *Media) Encode(ctx context.Context, req taskencoder.EncodeRequest) (_ *taskschema.Status, err error)
- func (m *Media) Metadata(ctx context.Context, req task.MetadataRequest) (_ *task.MetadataResponse, err error)
- func (m *Media) ProbeMedia(ctx context.Context, req task.ProbeMediaRequest) (_ *task.ProbeResponse, err error)
- func (m *Media) ProbeSource(ctx context.Context, req task.ProbeSourceRequest) (_ *task.ProbeResponse, err error)
- func (m *Media) Run(ctx context.Context, _ *slog.Logger) (err error)
- type Opt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Media ¶
type Media struct {
// contains filtered or unexported fields
}
func (*Media) Encode ¶ added in v1.9.3
func (m *Media) Encode(ctx context.Context, req taskencoder.EncodeRequest) (_ *taskschema.Status, err error)
Encode starts the encoder task on the new task manager (m.opt.taskManager) and returns immediately with its current status - encoding is long-running, so this doesn't wait for it to complete. The task stays tracked by the task manager afterwards (see task/httphandler), for a caller to poll, stream events for, or cancel by its UUID.
func (*Media) Metadata ¶ added in v1.9.2
func (m *Media) Metadata(ctx context.Context, req task.MetadataRequest) (_ *task.MetadataResponse, err error)
Metadata runs the metadata-extraction task on the new task manager (m.opt.taskManager) and waits for it to complete.
func (*Media) ProbeMedia ¶ added in v1.9.2
func (m *Media) ProbeMedia(ctx context.Context, req task.ProbeMediaRequest) (_ *task.ProbeResponse, err error)
Probe a media stream from any reader and return information about its container format and streams. The probe runs as a task tracked by the Media's task manager, so it's cancelled along with any other running task if Run's context is cancelled while the probe is in flight.
func (*Media) ProbeSource ¶ added in v1.9.2
func (m *Media) ProbeSource(ctx context.Context, req task.ProbeSourceRequest) (_ *task.ProbeResponse, err error)
ProbeSource probes a URL - a device (see ProbeSourceTask's doc comment for the "device://" scheme), or a network source FFmpeg can read directly (http, https, rtmp, ...) - rather than an already-open reader. Like Probe, this runs as a task tracked by the Media's task manager.
type Opt ¶
type Opt func(*opt) error
Opt is a functional option for filer manager configuration.
func WithChromaprintKey ¶ added in v1.9.2
WithChromaprintKey creates and stores a Chromaprint client.
func WithProfileManager ¶ added in v1.9.2
func WithProfileManager(profiles *profilemanager.Profile) Opt
WithProfileManager sets the profile manager used to resolve encoding profiles.
func WithTaskManager ¶ added in v1.9.2
func WithTaskManager(tasks *taskmanager.Manager) Opt
WithTaskManager sets the task manager used to track tasks.
func WithTracer ¶
WithTracer sets the tracer used for tracing operations.