cmd

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Copyright © 2023 Abiira Nathan <nabiira2by2@gmail.com>

Copyright © 2023 NAME HERE <EMAIL ADDRESS>

Index

Constants

View Source
const (
	OVERLAY_CENTER        = "(main_w-overlay_w)/2:(main_h-overlay_h)/2"
	OVERLAY_TOP_LEFT      = "10:10"
	OVERLAY_TOP_RIGHT     = "(main_w-overlay_w)-10:10"
	OVERLAY_TOP_CENTER    = "(main_w-overlay_w)/2:10"
	OVERLAY_BOTTOM_LEFT   = "10:(main_h-overlay_h)-10"
	OVERLAY_BOTTOM_RIGHT  = "(main_w-overlay_w)-10:(main_h-overlay_h)-10"
	OVERLAY_BOTTOM_CENTER = "(main_w-overlay_w)/2:(main_h-overlay_h)-10"
)

Variables

This section is empty.

Functions

func AddSubtitles

func AddSubtitles(inputFilename, outputFilename, subtitlesFilename string) error

Function to add subtitles to a video

func ApplyImageWatermark

func ApplyImageWatermark(inputFilename, outputFilename,
	watermarkImage string, position string, width, height int) error

Function to apply a watermark image on a video with a specific size

func ApplyTextWatermark

func ApplyTextWatermark(inputFilename, outputFilename, text, position, bgColor, fgColor string, fontSize float32, fontPath string) error

Function to apply a text watermark on a video with a specific size

func ApplyVideoFilter

func ApplyVideoFilter(inputFilename, outputFilename, filterExpression string) error

Function to apply a video filter to a video file

func ChangeAudioVolume

func ChangeAudioVolume(inputFilename, outputFilename string, volumeFactor float32) error

Function to change the volume of an audio file

func ConcatenateVideos

func ConcatenateVideos(inputFilenames []string, outputFilename string, destWidth, destHeight int) error

func ConvertToGif

func ConvertToGif(inputFilename, outputFilename string, width, height, fps int, from, to string) error

Function to convert a video file to a GIF

func ConvertVideos

func ConvertVideos(globPattern, outputFormat, outputDir string, quality int) error

Convert videos matching a glob pattern to output format with specified quality Codec is guessed from output format: e.g mp4, mkv, etc quality value should be between 1 and 31, where 1 represents the highest quality

func ExecShell

func ExecShell(command string) error

ffmpeg -nostats -progress pipe:1

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func ExtractAudioChannel

func ExtractAudioChannel(inputFilename, outputFilename string, channelIndex int) error

Function to extract a specific audio channel from a multi-channel audio file

func ExtractAudioChannels

func ExtractAudioChannels(inputFilename, outputFilename string, channelIndices []int) error

Function to extract specific audio channels from a multi-channel audio file

func ExtractAudioFrequencies

func ExtractAudioFrequencies(inputFilename, outputFilename string, startFrequency, endFrequency int) error

Generate a new audio file containing only the frequencies within the specified range.

func ExtractAudioFromVideoWithTimestamps

func ExtractAudioFromVideoWithTimestamps(videoFilename, outputFilename string, codec string,
	startTimestamp, endTimestamp string) error

Extract audio from a video with specified audio codec. default is to copy source codec startTimestamp and/or endTimestamp are optional. If codec is empty string will use source codec.

func ExtractFrame

func ExtractFrame(inputFilename, outputFilename string, timestamp string) error

Extract frame at given video timestamp. To use this function, you need to pass the input video file, output image filename, and the desired timestamp in the format "hh:mm:ss" (e.g., "00:01:23" to extract the frame at 1 minute and 23 seconds)

func ExtractFrameAtTimestamps

func ExtractFrameAtTimestamps(inputFilename, outputDirectory string, timestamps []string) error

Extract a video frame/image to jpg per timestamp.

func ExtractFrames

func ExtractFrames(inputFilename, outputPattern string, frameRate int) error

Function to extract frames from a video

func ExtractStereoChannels

func ExtractStereoChannels(inputFilename, outputLeftFilename, outputRightFilename string) error

* ExtractStereoChannels function takes the input audio file path and the output file paths for the left and right channels. It uses the pan audio filter with the 1c option to extract each channel separately. The c0=c0 parameter specifies that the left channel should be taken from the original audio's first channel (c0), and c0=c1 specifies that the right channel should be taken from the original audio's second channel (c1). The resulting audio files will contain the left and right channels of the stereo audio, respectively

func ExtractVideoSegment

func ExtractVideoSegment(inputFilename, outputFilename, startTime, duration string) error

Function to extract a specific video segment based on duration

func ImagesToVideo

func ImagesToVideo(inputFormat, outputFilename string, framerate, width, height int) error

Function to convert a series of images to a video file e.g ImagesToVideo("input_images/*.png", "output.mp4", 30, 640, 480, "slow")

func MergeAudioWithVideo

func MergeAudioWithVideo(audioFilename, videoFilename, outputFilename string) error

Function to merge an audio file with a video file

func PrintMediaMetadata

func PrintMediaMetadata(filename string) error

Prints the metadata for a media file.

func ResizeVideo

func ResizeVideo(input, output string, width, height int) error

func RotateVideo

func RotateVideo(inputFilename, outputFilename string, angle int) error

func ScaleImage

func ScaleImage(inputFilename, outputFilename string, width, height int) error

Scale image to given width and height.

func ScaleImageToAspectRation

func ScaleImageToAspectRation(inputFilename, outputFilename string, aspectRation float32) error

Scale image to a given aspect ratio.

func TrimSilence

func TrimSilence(inputFilename, outputFilename string, silenceThreshold float64) error

Remove silent parts from a video or audio.

func VideoToImages

func VideoToImages(inputFilename, outputDirectory,
	imageFormat string, width, height int, from string, to string) error

Function to convert a video file to a series of images To keep original dimensions of video. Pass width=0 and height=0

Types

This section is empty.

Jump to

Keyboard shortcuts

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