screengen

package module
v0.0.0-...-b9d28df Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2020 License: GPL-3.0 Imports: 6 Imported by: 1

README

screengen License GoDoc Pipeline status

A library for generating screenshots from video files, and a command-line tool for generating thumbnail grids.

Install the package

go get -u gitlab.com/opennota/screengen

Install the command-line tool

go get -u gitlab.com/opennota/screengen/cmd/screengen

Also

  • There is a similar program by that name.

  • For a more feature-rich command-line thumbnail grid generator (which also doesn't require ImageMagick) see mutschler/mt.

Documentation

Overview

Package screengen can be used for generating screenshots from video files.

Index

Constants

View Source
const (
	AVIdentity Orientation = 0

	AVRotation90 = 1 << iota
	AVRotation180
	AVRotation270
	AVRotationCustom
	AVFlipHorizontal
	AVFlipVertical
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator struct {
	Fast bool // Imprecise (but faster) seek; set by the user

	Filename string // Video file name

	Duration           int64   // Duration of the video in milliseconds
	VideoCodec         string  // Name of the video codec
	VideoCodecLongName string  // Readable/long name of the video codec
	FPS                float64 // Frames Per Second

	AudioCodec         string // Name of the audio codec
	AudioCodecLongName string // Readable/long name of the audio codec

	Bitrate     int
	Orientation Orientation
	// contains filtered or unexported fields
}

Generator is used to generate screenshots from a video file.

func NewGenerator

func NewGenerator(fn string) (_ *Generator, err error)

NewGenerator returns new generator of screenshots for the video file fn.

func (*Generator) Close

func (g *Generator) Close() error

Close closes the internal ffmpeg context.

func (*Generator) Height

func (g *Generator) Height() int

Height returns the height of the video

func (*Generator) Image

func (g *Generator) Image(ts int64) (image.Image, error)

Image returns a screenshot at the ts milliseconds.

func (*Generator) ImageWxH

func (g *Generator) ImageWxH(ts int64, width, height int) (image.Image, error)

ImageWxH returns a screenshot at the ts milliseconds, scaled to the specified width and height.

func (*Generator) Width

func (g *Generator) Width() int

Width returns the width of the video

type Orientation

type Orientation int

Directories

Path Synopsis
cmd
screengen
A tool that generates thumbnail grids from video files with the help of ImageMagick's convert.
A tool that generates thumbnail grids from video files with the help of ImageMagick's convert.

Jump to

Keyboard shortcuts

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