Documentation
¶
Index ¶
- func DecoderArguments(videoStats ffmpeg.VideoStats) []string
- func Inspect(ctx context.Context, ch <-chan *WorkItem, cfg Configuration, ...)
- func Run(subCtx context.Context, cfg Configuration, queue *Queue, l *slog.Logger) error
- func Scan(ctx context.Context, baseDir string, queue *Queue, ch chan<- *WorkItem, ...) error
- func ScanFS(ctx context.Context, fileSystem fs.FS, baseDir string, queue *Queue, ...) error
- func SupportedProfiles() []string
- func Transcode(ctx context.Context, queue *Queue, cfg Configuration, logger *slog.Logger)
- type Configuration
- type Decoder
- type Log
- type MediaFile
- type Profile
- type Progress
- type Queue
- func (q *Queue) Active() bool
- func (q *Queue) Add(filename string) *WorkItem
- func (q *Queue) All() iter.Seq[*WorkItem]
- func (q *Queue) List() []*WorkItem
- func (q *Queue) NextToConvert() *WorkItem
- func (q *Queue) Queue(item *WorkItem)
- func (q *Queue) SetActive(active bool)
- func (q *Queue) Size() int
- func (q *Queue) Stats() map[Status]int
- func (q *Queue) ToggleActive()
- type Rule
- type SourceRejectedError
- type SourceSkippedError
- type Status
- type WorkItem
- func (w *WorkItem) CompletedFormatted() string
- func (w *WorkItem) RemainingFormatted() string
- func (w *WorkItem) SetWorkStatus(workStatus WorkStatus)
- func (w *WorkItem) SourceVideoStats() ffmpeg.VideoStats
- func (w *WorkItem) TargetVideoStats() ffmpeg.VideoStats
- func (w *WorkItem) WorkStatus() WorkStatus
- type WorkStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecoderArguments ¶
func DecoderArguments(videoStats ffmpeg.VideoStats) []string
func Inspect ¶
func Inspect(ctx context.Context, ch <-chan *WorkItem, cfg Configuration, probe func(string) (ffmpeg.VideoStats, error), f fileChecker, logger *slog.Logger)
func SupportedProfiles ¶
func SupportedProfiles() []string
Types ¶
type Configuration ¶
type Configuration struct {
Log
Input string `flagger.usage:"input directory"`
ProfileName string `flagger.name:"profile" flagger.usage:"conversion profile"`
Profile Profile `flagger.skip:"true"`
Active bool `flagger.usage:"start processor in active mode"`
Remove bool `flagger.usage:"remove source files after successful conversion"`
Overwrite bool `flagger.usage:"overwrite existing files"`
}
func GetConfigurationFromViper ¶
func GetConfigurationFromViper(v *viper.Viper) (cfg Configuration, err error)
type MediaFile ¶
type MediaFile struct {
Path string
VideoStats ffmpeg.VideoStats
}
type Profile ¶
func GetProfile ¶
GetProfile returns the profile associated with name.
type Queue ¶
type Queue struct {
// contains filtered or unexported fields
}
func (*Queue) List ¶
List returns all items in the queue. This clones the contained slice. For performance reasons, this should only be used for testing. Use All(), which returns an iterator, instead.
func (*Queue) NextToConvert ¶
func (*Queue) Queue ¶
Queue adds an item ready to be converted. This item will be processed, regardless of whether the queue is active or not.
func (*Queue) ToggleActive ¶
func (q *Queue) ToggleActive()
type Rule ¶
type Rule func(profile *Profile, sourceStats ffmpeg.VideoStats) error
func RejectBitrateTooLow ¶
func RejectBitrateTooLow() Rule
func RejectVideoHeightTooLow ¶
func SkipTargetCodec ¶
func SkipTargetCodec() Rule
type SourceRejectedError ¶
type SourceRejectedError struct {
Reason string
}
func (*SourceRejectedError) Error ¶
func (e *SourceRejectedError) Error() string
func (*SourceRejectedError) Is ¶
func (e *SourceRejectedError) Is(e2 error) bool
type SourceSkippedError ¶
type SourceSkippedError struct {
Reason string
}
func (*SourceSkippedError) Error ¶
func (e *SourceSkippedError) Error() string
func (*SourceSkippedError) Is ¶
func (e *SourceSkippedError) Is(e2 error) bool
type WorkItem ¶
type WorkItem struct {
Source MediaFile
Target MediaFile
Progress Progress
// contains filtered or unexported fields
}
func (*WorkItem) CompletedFormatted ¶
func (*WorkItem) RemainingFormatted ¶
func (*WorkItem) SetWorkStatus ¶
func (w *WorkItem) SetWorkStatus(workStatus WorkStatus)
func (*WorkItem) SourceVideoStats ¶
func (w *WorkItem) SourceVideoStats() ffmpeg.VideoStats
func (*WorkItem) TargetVideoStats ¶
func (w *WorkItem) TargetVideoStats() ffmpeg.VideoStats
func (*WorkItem) WorkStatus ¶
func (w *WorkItem) WorkStatus() WorkStatus
type WorkStatus ¶
Click to show internal directories.
Click to hide internal directories.