ffmpeg

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChopOneSegment

func ChopOneSegment(ctx context.Context, tempDir string, inputFile string, beginTS float64, endTS float64) (string, *log.Status)

ChopOneSegment uses timestamps extract one segment from an audio file

func ComputeDuration

func ComputeDuration(ctx context.Context, directory string, filename string) (float64, *log.Status)

func ConvertMp3ToWav

func ConvertMp3ToWav(ctx context.Context, tempDir string, inputFile string) (string, *log.Status)

func GetAudioBitrate

func GetAudioBitrate(ctx context.Context, directory string, filename string) (float64, *log.Status)

func GetAudioDuration

func GetAudioDuration(ctx context.Context, directory string, filename string) (float64, *log.Status)

func GetAudioSize

func GetAudioSize(ctx context.Context, directory string, filename string) (float64, *log.Status)

func OldConvertMp3ToWav

func OldConvertMp3ToWav(ctx context.Context, tempDir string, filePath string) (string, *log.Status)

OldConvertMp3ToWav is a legacy conversion function

Types

type AudioSegment

type AudioSegment struct {
	BeginTS       float64
	EndTS         float64
	BookId        string
	ChapterNum    int
	VerseStr      string
	AudioVerseWav string
}

AudioSegment holds the timestamp and metadata fields needed by ChopByTimestamp.

func ChopByTimestamp

func ChopByTimestamp(ctx context.Context, tempDir string, inputFile string, timestamps []AudioSegment) ([]AudioSegment, *log.Status)

ChopByTimestamp uses timestamps to chop timestamps into files, and puts the filenames in timestamp record.

type ProbeData

type ProbeData struct {
	Format ProbeFormat `json:"format"`
}

func GetProbeData

func GetProbeData(ctx context.Context, directory string, filename string) (ProbeData, *log.Status)

type ProbeFormat

type ProbeFormat struct {
	Filename       string `json:"filename"`
	NBStreams      int    `json:"nb_streams"`
	NBProgress     int    `json:"nb_programs"`
	NBStreamGroups int    `json:"nb_stream_groups"`
	FormatName     string `json:"format_name"`
	FormatLongName string `json:"format_long_name"`
	StartTime      string `json:"start_time"`
	Duration       string `json:"duration"`
	Size           string `json:"size"`
	BitRate        string `json:"bit_rate"`
	ProbeScore     int    `json:"probe_score"`
}

Jump to

Keyboard shortcuts

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