Documentation ¶
Overview ¶
Package gopro provides tools for manipulating GoPro videos including combining videos split into multiple chapters while maintaining metadata. It requires a working install of ffmpeg which provides the video processing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoMatch is returned by a matcher if no match is found. ErrNoMatch = errors.New("no match") // ErrNoFiles is returned if no files were found. ErrNoFiles = errors.New("no files found") )
var ( Hero5 = NewMatcherMust("hero5", `^(?i)GOPR([0-9]{4})\.mp4$`, `^(?i)GP([0-9]{2})([0-9]{4}).mp4$`) Hero10 = NewMatcherMust("hero10", `^(?i)G[HX]([0-9]{2})([0-9]{4})\.mp4$`) )
Formats are determined from: https://community.gopro.com/s/article/GoPro-Camera-File-Naming-Convention?language=en_US
var ( // DefaultConfig is the default configuration if not specified. DefaultConfig = &Config{ Binary: "ffmpeg", Args: []string{ "-y", "-safe", "0", "-f", "concat", "-i", "", "-c:a", "copy", "-c:d", "copy", "-c:v", "libx264", "-vf", "scale=1920:1080", "-copy_unknown", "-map_metadata", "0", "-movflags", "use_metadata_tags", "-map", "0:v", "-map", "0:a", "-map", "0:m:handler_name:\tGoPro TCD", "-map", "0:m:handler_name:\tGoPro MET", "-map", "0:m:handler_name:\tGoPro SOS", }, SourceDir: ".", OutputTemplate: "{{.Name}}-JOINED{{.Ext}}", LogLevel: "warn", } )
Functions ¶
func DefaultHandler ¶
DefaultHandler is the default Handler function which runs ffmpeg wiring up Stdout and Stderr.
Types ¶
type Config ¶
type Config struct { LogLevel string SourceDir string Binary string Args []string SkipNames []string OutputTemplate string OutputDir string Overwrite bool // contains filtered or unexported fields }
Config represents a GoPro video processing configuration.
type File ¶
type File struct { // Name is the raw filename. Name string // Chapter is the chapter of the video typically a two character number. // Depending on generation the first chapter may be 00 or 01. Chapter string // Index is video index of the video typically a 4 character number. Index string }
File represents a GoPro video file.
type FileSlice ¶
type FileSlice []File
FileSlice attaches the methods of sort.Interface to []File, sorting in increasing chapter order.
type Log ¶
type Log interface {
Println(v ...interface{})
}
Log is implemented by types which can act as Processor logger.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher provides the ability to identify GoPro video files.
func NewMatcher ¶
NewMatcher returns a fully initialised Matcher.
func NewMatcherMust ¶
NewMatcherMust returns a fully initialised Matcher and panics if any error occurs.
type Option ¶
Option represents an configuration option for Processor.
func CfgFile ¶
CfgFile loads the config from file for the Processor. Either CfgFile or Cfg must be specified.
type OutputFile ¶
type OutputFile struct { // Name excluding extension. Name string // Extension including the dot. Ext string }
OutputFile represents the template used for output file processing.
type Processor ¶
type Processor struct {
// contains filtered or unexported fields
}
Processor provides the ability to process GoPro video files. If it finds chaptered files they are joined during processing.
func NewProcessor ¶
NewProcessor creates and returns a configured Processor.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package gpmf provides GoPro metadata parsing as defined by: https://github.com/gopro/gpmf-parser
|
Package gpmf provides GoPro metadata parsing as defined by: https://github.com/gopro/gpmf-parser |
geo
Package geo implements gnomonic projection centered at an arbitrary position C on the ellipsoid.
|
Package geo implements gnomonic projection centered at an arbitrary position C on the ellipsoid. |