Documentation
¶
Index ¶
- func ListsMovie(dirVod string) (fname []string)
- func ListsTs(dirVod string)
- func ListsVod(dirVod string)
- func PeLs(dir, file string)
- func SetFileName(s string, p string, e string) (res string)
- type Movie
- type Movies
- type Stream
- type StreamVideo
- type Transcoder
- func (this *Transcoder) BuildSilence(d int) (res string, err error)
- func (this *Transcoder) BuildTs(f string, suf string) (ts string, err error)
- func (this *Transcoder) BuildVideo(f string, d int, a string) (fout string, err error)
- func (this *Transcoder) Conv(t string, fromFile string, name string, e string) error
- func (this *Transcoder) ConvMp4(e string, d int) (fout string, err error)
- func (this *Transcoder) FfProbe(dir, filename string) (movie Movies, err error)
- func (this *Transcoder) Info(filename string) (movie Movies, err error)
- func (this *Transcoder) InfoSrc(filename string) (m Movie, err error)
- func (this *Transcoder) Init()
- func (this *Transcoder) ListCovert() (fname []string)
- func (this Transcoder) SetMovie(s string) (m Movies)
- func (this Transcoder) SetStream(m Movies)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListsMovie ¶
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)
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 ¶
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) 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) 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)
Click to show internal directories.
Click to hide internal directories.