cmd

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

cmd/convert.go

cmd/info.go

cmd/root.go

cmd/util.go

cmd/version.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFFmpeg

func CheckFFmpeg() error

CheckFFmpeg checks if FFmpeg is installed and returns an error if not

func Execute

func Execute()

func GetLogger

func GetLogger() *logrus.Logger

func GetOptimalThreads

func GetOptimalThreads() int

GetOptimalThreads returns the optimal number of threads to use based on CPU cores

func GetVideoInfo

func GetVideoInfo(videoPath string) (map[string]string, error)

GetVideoInfo uses FFmpeg to extract basic information about a video file

func HumanizeBytes

func HumanizeBytes(bytes int64) string

HumanizeBytes converts bytes to a human-readable format (KB, MB, GB)

func ValidateTimeFormat

func ValidateTimeFormat(timeStr string) bool

ValidateTimeFormat checks if a time string is in the format HH:MM:SS or HH:MM:SS.MS

Types

type ConvertOptions

type ConvertOptions struct {
	Input       string
	Output      string
	FPS         int
	Start       string
	Duration    string
	Width       int
	Quality     int
	Interactive bool
	NoProgress  bool
}

type ProgressData

type ProgressData struct {
	StartTime       time.Time
	CurrentTime     float64
	TotalDuration   float64
	ProcessingRate  float64 // Ratio of processing speed to real-time
	CurrentSize     int64
	SizeUnit        string
	Bitrate         float64
	BitrateUnit     string
	FramesProcessed int64
	Width           int
	Height          int
	AvgProcessRate  float64 // Average processing rate relative to real-time
	Frames          int
}

ProgressData tracks the current state of the conversion

type ProgressUpdate

type ProgressUpdate struct {
	CurrentTime     float64
	TotalDuration   float64
	ProcessingRate  float64 // Speed relative to real-time playback
	CurrentSize     int64
	SizeUnit        string
	Bitrate         float64
	BitrateUnit     string
	FramesProcessed int64
	Width           int
	Height          int
}

ProgressUpdate represents a progress update sent through the channel

Jump to

Keyboard shortcuts

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