transcoder

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: MIT Imports: 1 Imported by: 0

README

Golang Transcoding Library



Created by FlooStack.

Features

Ease use
Implement your own business logic around easy interfaces
Transcoding progress
Obtain progress events generated by transcoding application process

Download from Github

go get github.com/Borloxos/transcoder

Example

package main

import (
	"log"

	ffmpeg "github.com/Borloxos/transcoder/ffmpeg"
)

func main() {

	format := "mp4"
	overwrite := true

	opts := ffmpeg.Options{
		OutputFormat: &format,
		Overwrite:    &overwrite,
	}

	ffmpegConf := &ffmpeg.Config{
		FfmpegBinPath:   "/usr/local/bin/ffmpeg",
		FfprobeBinPath:  "/usr/local/bin/ffprobe",
		ProgressEnabled: true,
	}

	progress, err := ffmpeg.
		New(ffmpegConf).
		Input("/tmp/avi").
		Output("/tmp/mp4").
		WithOptions(opts).
		Start(opts)

	if err != nil {
		log.Fatal(err)
	}

	for msg := range progress {
		log.Printf("%+v", msg)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface{}

Config ...

type Options

type Options interface {
	GetStrArguments() []string
}

Options ...

type Progress

type Progress interface {
}

Progress ...

type Transcoder

type Transcoder interface {
	Start(opts Options) (<-chan Progress, error)
	Input(i string) Transcoder
	InputPipe(w *io.WriteCloser, r *io.ReadCloser) Transcoder
	Output(o string) Transcoder
	OutputPipe(w *io.WriteCloser, r *io.ReadCloser) Transcoder
	WithOptions(opts Options) Transcoder
}

Transcoder ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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