timelapse

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: MIT Imports: 10 Imported by: 0

README

timelapse Build

A tool to create timelapses from a series of images using ImageMagick and FFMpeg.

Usage

Downlad the latest release here.

Linux (x64)

./timelapse-linux-amd64 --source-directory=/path/to/image/directory

Embedded Go

View the example or the CLI.

Documentation

Overview

Package timelapse provides the ability to generate a timelapse video from a series of sorted images.

Example Usage:

package main

import (
	"context"
	"fmt"
	"os"

	"github.com/mpawlowski/timelapse"
	"github.com/mpawlowski/timelapse/src/pkg/ffmpeg"
	"github.com/mpawlowski/timelapse/src/pkg/imagemagick"
)

func main() {
	im := imagemagick.NewImageMagick()
	ff := ffmpeg.NewFFMpeg()
	tl := timelapse.NewTimelapseGenerator(im, ff)

	ctx := context.Background()
	sourceDir := "path/to/images"
	outputFile := "output.mp4"

	err := tl.GenerateTimelapse(ctx, sourceDir, outputFile)
	if err != nil {
		fmt.Println(err)
		os.Exit(1)
	}
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FxOptions

func FxOptions() []fx.Option

FxOptions returns an array of fx.Options for use of the timelapse package with go.uber.org/fx.

Example Usage:

app := fx.New(
	timelapse.FxOptions()...,
)

Types

type Option

type Option func(*timelapseOptions)

Option is an interface for functional options.

func WithFFMpegVideoOptions

func WithFFMpegVideoOptions(opts ...ffmpeg.Option) Option

WithFFMpegVideoOptions is a functional option for setting ffmpeg options.

func WithImageMagickMorphOptions

func WithImageMagickMorphOptions(opts ...imagemagick.ConvertOption) Option

WithImageMagickMorphOptions is a functional option for setting imagemagick options.

type TimelapseGenerator

type TimelapseGenerator interface {
	// GenerateTimelapse creates a timelapse video from a series of images.
	GenerateTimelapse(ctx context.Context, sourceDir string, outputFile string, options ...Option) error
}

func NewTimelapseGenerator

func NewTimelapseGenerator(
	im imagemagick.ImageMagickConvert,
	ff ffmpeg.FFMpeg,
) TimelapseGenerator

NewTimelapseGenerator creates a new TimelapseGenerator instance.

Directories

Path Synopsis
src
Package src contains source code for the timelapse package.
Package src contains source code for the timelapse package.
bin
Package bin contains executable source code for the timelapse package.
Package bin contains executable source code for the timelapse package.
bin/cli command
Package cli provides a command line interface for generating a timelapse video from a series of images.
Package cli provides a command line interface for generating a timelapse video from a series of images.
bin/example command
pkg
Package pkg contains non-executable source code for the timelapse package.
Package pkg contains non-executable source code for the timelapse package.
pkg/ffmpeg
Package ffmpeg provides a wrapper around the FFMpeg binary.
Package ffmpeg provides a wrapper around the FFMpeg binary.
pkg/imagemagick
Package imagemagick provides a wrapper around the ImageMagick binary.
Package imagemagick provides a wrapper around the ImageMagick binary.
pkg/osutil
Package osutil provides reusable functions not available in the standard library's os package.
Package osutil provides reusable functions not available in the standard library's os package.

Jump to

Keyboard shortcuts

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