Documentation ¶
Index ¶
- func AnalyzeFrames(ctx context.Context, inputFile io.Reader, framesChan chan<- FrameType, ...)
- func AviScanner(reader io.Reader) *bufio.Scanner
- func ConvertToAvi(ctx context.Context, ffmpegPath string, ffmpegLogPath string, inputFile string, ...)
- func ConvertToMp4(ctx context.Context, ffmpegPath string, ffmpegLogPath string, aviFile string, ...)
- func FindScenes(ctx context.Context, ffmpegPath string, ffmpegLogPath string, inputFile string, ...)
- func RemoveFrames(ctx context.Context, input io.Reader, output io.Writer, ...)
- type FrameType
- type VideoTime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeFrames ¶
func AnalyzeFrames(ctx context.Context, inputFile io.Reader, framesChan chan<- FrameType, errorChan chan<- error)
AnalyzeFrames analyzes the frames in the given file, writing results to the channel provided. The file is assumed to have AVI format. Any errors encountered are sent to the error channel. The error channel is closed when processing is finished.
func AviScanner ¶
AviScanner returns a Scanner that reads an AVI file frame-by-frame.
func ConvertToAvi ¶
func ConvertToAvi(ctx context.Context, ffmpegPath string, ffmpegLogPath string, inputFile string, outputFile string, quality float64, iFrameIndices []uint64, progressChan chan<- float64, errorChan chan<- error)
ConvertToAvi uses ffmpeg to convert the input file into a mute AVI file for datamoshing. The encoding quality of the output file is determined by the quality parameter, with 0.0 being the lowest and 1.0 being highest possible quality setting. If iFrameIndices is not nil, automatic I-Frame generation is disabled and I-Frames are placed at the given frame indices. The encoding progress is frequently written to the progress channel as a value between 0.0 and 1.0. The error channel is closed when processing is finished.
func ConvertToMp4 ¶
func ConvertToMp4(ctx context.Context, ffmpegPath string, ffmpegLogPath string, aviFile string, soundFile string, outputFile string, quality float64, progressChan chan<- float64, errorChan chan<- error)
ConvertToMp4 uses ffmpeg to convert the input file into an MP4 file, taking the audio stream from another file. If the sound file path is empty, no audio is added to the output file. The encoding quality of the output file is determined by the quality parameter, with 0.0 being the lowest and 1.0 being highest possible quality setting. The encoding progress is frequently written to the progress channel as a value between 0.0 and 1.0. Any errors encountered are sent to the error channel. The error channel is closed when processing is finished.
func FindScenes ¶
func FindScenes(ctx context.Context, ffmpegPath string, ffmpegLogPath string, inputFile string, threshold float64, sceneTimeChan chan<- VideoTime, progressChan chan<- float64, errorChan chan<- error)
FindScenes uses ffmpeg to find scene changes in the input file, using the given similarity threshold between 0 and 1. The detection progress is frequently written to the progress channel as a value between 0.0 and 1.0. Any errors encountered are sent to the error channel. The error channel is closed when processing is finished.
func RemoveFrames ¶
func RemoveFrames(ctx context.Context, input io.Reader, output io.Writer, framesToRemove []uint64, processedChan chan<- uint64, errorChan chan<- error)
RemoveFrames writes a copy of the AVI data from the input reader to the output writer, replacing the frames at the given indices with the following frame. Any errors encountered are sent to the error channel. The error channel is closed when processing is finished.