processing

package
v0.0.0-...-aa6cde0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: GPL-3.0 Imports: 26 Imported by: 0

Documentation

Overview

Package processing provides video processing orchestration.

Package processing provides video processing orchestration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckChunkedDependencies

func CheckChunkedDependencies() error

CheckChunkedDependencies verifies that required tools are available.

func FormatAudioDescription

func FormatAudioDescription(channels []uint32) string

FormatAudioDescription formats a basic audio description.

func FormatAudioDescriptionConfig

func FormatAudioDescriptionConfig(channels []uint32, streams []media.AudioStreamInfo) string

FormatAudioDescriptionConfig formats audio description for config display.

func GenerateAudioResultsDescription

func GenerateAudioResultsDescription(channels []uint32, streams []media.AudioStreamInfo) string

GenerateAudioResultsDescription generates audio description for results.

func GetAudioStreamInfo

func GetAudioStreamInfo(inputPath string) []media.AudioStreamInfo

GetAudioStreamInfo returns detailed audio stream information.

func GetOutputDimensions

func GetOutputDimensions(originalWidth, originalHeight uint32, cropFilter string) (uint32, uint32)

GetOutputDimensions calculates final output dimensions after crop.

Types

type CropResult

type CropResult struct {
	CropFilter     string // The crop filter string (e.g., "crop=1920:800:0:140")
	Required       bool   // Whether cropping is required
	MultipleRatios bool   // Whether multiple aspect ratios were detected
	Message        string // Human-readable message about the crop result
}

CropResult contains the result of crop detection.

func DetectCrop

func DetectCrop(inputPath string, inf *video.Info, disableCrop bool) CropResult

DetectCrop detects black bars using decoded luma samples. It samples the middle 70% of the video, ignores all-black frames, and uses the minimum crop seen across valid samples so mixed-aspect content is not over-cropped.

func ProcessChunked

func ProcessChunked(
	ctx context.Context,
	cfg *config.Config,
	inputPath, outputPath string,
	videoProps *media.VideoProperties,
	vidInf *video.Info,
	audioStreams []media.AudioStreamInfo,
	qualitySetting float32,
	rep reporter.Reporter,
	perfc *perf.Collector,
) (CropResult, error)

ProcessChunked runs the chunked encoding pipeline for a single file. Returns the crop result so the caller can use it for validation.

type EncodeResult

type EncodeResult struct {
	Filename          string
	Duration          time.Duration
	InputSize         uint64
	OutputSize        uint64
	InputVideoSize    uint64
	OutputVideoSize   uint64
	VideoDurationSecs float64
	EncodingSpeed     float32
	ValidationPassed  bool
	ValidationSteps   []validation.ValidationStep
}

EncodeResult contains the result of a single file encode.

func ProcessVideos

func ProcessVideos(
	ctx context.Context,
	cfg *config.Config,
	filesToProcess []string,
	targetFilenameOverride string,
	rep reporter.Reporter,
) ([]EncodeResult, error)

ProcessVideos orchestrates encoding for a list of video files.

Jump to

Keyboard shortcuts

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