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 ¶
Types ¶
type Option ¶
type Option func(*timelapseOptions)
Option is an interface for functional options.
func WithFFMpegVideoOptions ¶
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 |
|---|---|
|
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. |
Click to show internal directories.
Click to hide internal directories.