rmads

package
v0.0.0-...-6b654bc Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePreviews

func CreatePreviews(videoPath string) error

func DisplayPreview

func DisplayPreview(videoPath string)

func GetShowDuration

func GetShowDuration(ctx context.Context, inputFilePath string) (time.Duration, error)

func Preview

func Preview(ctx context.Context) error

func RemoveAds

func RemoveAds(ctx context.Context) error

Types

type Markers

type Markers struct {
	Segments   Segments   `json:"segments,omitempty"`
	Timestamps Timestamps `json:"timestamps,omitempty"`
}

func ImportSkipFile

func ImportSkipFile(skipFilePath string, shift time.Duration) (*Markers, error)

func ImportTivoClipMetadata

func ImportTivoClipMetadata(tivoClipMetadata []byte, shift time.Duration) (*Markers, error)

func ImportVideoRedoV3Skip

func ImportVideoRedoV3Skip(videoRedoData []byte) (*Markers, error)

type Segment

type Segment struct {
	Description string        `json:"description,omitempty"`
	StartOffset time.Duration `json:"startOffset,omitempty"`
	EndOffset   time.Duration `json:"endOffset,omitempty"`
}

type Segments

type Segments []Segment

func (Segments) Invert

func (s Segments) Invert(endOffset time.Duration) Segments

Invert will, given a list of non-overlapping continuously increasing segments, returns a list of segments that captures the inversion of the input list. For example, if the input segment is a list of time frames to cut out of a video, then the inversion would be a list of time frames to keep:

input:    {5:10}, {15:20}, {30:40}
inverted: {0:5},  {10:15}, {20:30}, {40:end}

func (Segments) Remove

func (s Segments) Remove(ctx context.Context, inputFilePath, outputFilePath string) error

ffmpeg -y -i example.mp4 -vf select='between(t\,10\,20)+between(t\,30\,40\),setpts=N/FRAME_RATE/TB' -af aselect='between(t\,10\,20)+between(t\,30\,40\),asetpts=N/SR/TB' test_output.mp4 ffmpeg -y -i intTestTransportStream.ts -vf select='between(t\\,0\\,413)+between(t\\,607\\,970)+between(t\\,1166\\,1679)+between(t\\,1903\\,1980),setpts=N/FRAME_RATE/TB' -af aselect='between(t\\,0\\,413)+between(t\\,607\\,970)+between(t\\,1166\\,1679)+between(t\\,1903\\,1980),asetpts=N/SR/TB'"

type Timestamp

type Timestamp struct {
	Description string        `json:"description,omitempty"`
	Timestamp   time.Duration `json:"timestamp,omitempty"`
}

type Timestamps

type Timestamps []Timestamp

type TivoClipMetadata

type TivoClipMetadata struct {
	ClipMetadata []struct {
		Segment []struct {
			StartOffset string `json:"startOffset"`
			EndOffset   string `json:"endOffset"`
		} `json:"segment"`
	} `json:"clipMetadata"`
}

Jump to

Keyboard shortcuts

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