goffmpeg

package module
v0.0.0-...-7e592f5 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2015 License: MIT Imports: 12 Imported by: 0

README

goffmpeg

Go bindings for FFmpeg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListsMovie

func ListsMovie(dirVod string) (fname []string)

func ListsTs

func ListsTs(dirVod string)

func ListsVod

func ListsVod(dirVod string)

func PeLs

func PeLs(dir, file string)

func SetFileName

func SetFileName(s string, p string, e string) (res string)

SetFileName("name.ext", "/prefix/", "newext") Return: /prefix/name.newext

Types

type Movie

type Movie struct {
	ID                 int64  `json:"id"`
	Title              string `json:"title"`
	Filename           string `json:"filename"`
	IsVideo            bool   `json:"is_video"`
	IsAudio            bool   `json:"is_audio"`
	IsTs               bool   `json:"is_ts"`
	Duration           int    `json:"duration"`
	Types              string `json:"types"`   // MOVIE_VIDEO MOVIE_IMAGE MOVIE_AUDIO MOVIE_SERIAL MOVIE_FILM len(12)
	Formats            string `json:"formats"` // 720p 1080p len(5)
	Status             string `json:"status"`  // CONV_NO_CONVERT CONV_PROGRES CONV_IS_NOT_CONVERT CONV_CONVERT len(19)
	Width              int    `json:"width"`
	Height             int    `json:"height"`
	CodecVideo         string `json:"codec_video"`
	CodecAudio         string `json:"codec_audio"`
	DisplayAspectRatio string `json:"display_aspect_ratio"`
	BitRate            string `json:"bit_rate"`
}

type Movies

type Movies struct {
	TsVideos       []sVideo `json:"streams"`
	Format         sFormat  `json:"format"`
	IsVideo        bool     `json:"isVideo"`
	IsAudio        bool     `json:"isAudio"`
	Duration       string   `json:"duration"`
	DurationSeonds int      `json:"durationSeconds"`
	CountVideo     int8     `json:"cntVideo"`
	CountAudio     int8     `json:"cntAudio"`
}

func (Movies) SetStream

func (m Movies) SetStream(t *Transcoder)

func (Movies) Show

func (this Movies) Show()

type Stream

type Stream struct {
	Index     int64  `json:"index"`
	Name      string `json:"name"`
	CodecName string `json:"codec_name"`
	CodecType string `json:"codec_type"`
	Width     int    `json:"width"`
	Height    int    `json:"height"`
	Duration  int    `json:"duration"`
	Filename  string `json:"filename"`
	IsVideo   bool   `json:"-"`
	IsAudio   bool   `json:"-"`
	IsConvert bool   `json:"-"`
}

type StreamVideo

type StreamVideo struct {
	Id                 int64     `json:"-"`
	Index              int64     `json:"index"`
	Name               string    `json:"name"`
	CodecName          string    `json:"codec_name"`
	CodecType          string    `json:"codec_type"`
	Width              int       `json:"width"`
	Height             int       `json:"height"`
	Duration           string    `json:"duration"`
	DisplayAspectRatio string    `json:"display_aspect_ratio"`
	BitRate            string    `json:"bit_rate"`
	TagsVideo          sTagVideo `json:"tags"`
}

type Transcoder

type Transcoder struct {
	Name           string   `json:"name"`
	Filename       string   `json:"filename"`
	IsVideo        bool     `json:"isVideo"`
	IsAudio        bool     `json:"isAudio"`
	DirVideoVod    string   `json:"-"`
	DirConvTs      string   `json:"-"`
	DirTs          string   `json:"-"`
	DirTmp         string   `json:"-"`
	Streams        []Stream `json:"streams"`
	Movie          *Movies  `json:"-"`
	Duration       string   `json:"duration"`
	DurationSeonds int      `json:"duration_seconds"`
	CountVideo     int8     `json:"-"`
	CountAudio     int8     `json:"-"`
	BitRate        string   `json:"-"`
	LogLevel       string   `json:"-"`
}

func (*Transcoder) BuildSilence

func (this *Transcoder) BuildSilence(d int) (res string, err error)

func (*Transcoder) BuildTs

func (this *Transcoder) BuildTs(f string, suf string) (ts string, err error)

func (*Transcoder) BuildVideo

func (this *Transcoder) BuildVideo(f string, d int, a string) (fout string, err error)

ffmpeg -i in.avi -r 25 -s 1280x720 -c:a copy -c:v libx264 -b:v 2000k -profile:v high -level 4.0 -pix_fmt yuv420p -threads 4 -ss 00:00:00 -t 00:00:20 -async 1 -vsync 1 -y

func (*Transcoder) Conv

func (this *Transcoder) Conv(t string, fromFile string, name string, e string) error

TODO remove

func (*Transcoder) ConvMp4

func (this *Transcoder) ConvMp4(e string, d int) (fout string, err error)

d - продолжительность ролика

func (*Transcoder) FfProbe

func (this *Transcoder) FfProbe(dir, filename string) (movie Movies, err error)

func (*Transcoder) Info

func (this *Transcoder) Info(filename string) (movie Movies, err error)

func (*Transcoder) InfoSrc

func (this *Transcoder) InfoSrc(filename string) (m Movie, err error)

filename - полный путь к видео файлу

func (*Transcoder) Init

func (this *Transcoder) Init()

func (*Transcoder) ListCovert

func (this *Transcoder) ListCovert() (fname []string)

func (Transcoder) SetMovie

func (this Transcoder) SetMovie(s string) (m Movies)

func (Transcoder) SetStream

func (this Transcoder) SetStream(m Movies)

TODO remove

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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