seratools

package
v1.2.26 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateTimecode

func CalculateTimecode(currentFrame int, fps float64, totalFrames int) string

CalculateTimecode calculates the timecode of a given frame based on the frames per second and total frames. It takes three parameters: - currentFrame: The current frame number. - fps: The number of frames per second. - totalFrames: The total number of frames in the video. It returns the timecode in the format "hh:mm:ss".

func DivideFrameRange

func DivideFrameRange(startFrame int, endFrame int, segments int) []int

DivideFrameRange divides a range of frames into segments and returns the middle frame of each segment. It takes three parameters: - startFrame: The first frame of the range. - endFrame: The last frame of the range. - segments: The number of segments to divide the range into. It returns a slice of integers representing the middle frame of each segment.

func ExtractFrames

func ExtractFrames(videoPath string, frameNumbers []int, totalFrames int, fps int, outputPath string) error

ExtractFrames extracts specific frames from a video file and saves them as images. It takes the path to the video file, a slice of frame numbers to extract, the total number of frames in the video, the frames per second of the video, and the output path where the images will be saved. It uses a progress bar to show the progress of the frame extraction. For each frame number in the slice, it reads the frame from the video and writes it to a file. The files are named using the timecode of the frame in the video. If it encounters an error while opening the video file, reading a frame, or writing a frame to a file, it returns the error. Otherwise, it returns nil.

func RemoveDuplicates

func RemoveDuplicates(slice []interface{}) []interface{}

RemoveDuplicates removes duplicate values from a slice. It takes a slice of empty interfaces as a parameter and returns a new slice with duplicates removed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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