collections

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ExtractionDirName store directory name of extracted HLS files
	ExtractionDirName = "generated_hls"
)

Variables

This section is empty.

Functions

func ExtractThumb

func ExtractThumb(moviePath, thumbPath string, seconds int) error

ExtractThumb will extract thumbnail image from video file

func GetVTTFileName added in v1.2.0

func GetVTTFileName(srtFileName string) string

GetVTTFileName will return .vtt file based on given file name with ext

func Identify

func Identify(basePath string, file os.FileInfo) ([]MovieDirInfo, []SubDirInfo, error)

Identify single directory of movie

func IsTextSrt added in v1.2.0

func IsTextSrt(path string) bool

IsTextSrt will return valid status detection of .srt file

func ProcessSrt added in v1.2.0

func ProcessSrt(db *gorm.DB, movie *models.Movie, appDir string) error

ProcessSrt will detect .srt files on DB and convert it into .vtt to extracted movie dir

func ScanDir

func ScanDir(path string) ([]MovieDirInfo, []SubDirInfo, error)

ScanDir will return flat list of Movie directory information

Types

type MovieDirInfo

type MovieDirInfo struct {
	Dir       string
	MovieFile string
	MovieSize float64
	Info      os.FileInfo
	MimeType  string
}

MovieDirInfo is a holder to keep movie directory information

type SubDirInfo added in v1.2.0

type SubDirInfo struct {
	Dir     string
	SubFile string
	Info    os.FileInfo
}

SubDirInfo is a holder to subtitle information

type TranscodingError added in v1.2.0

type TranscodingError struct {
	Resolution string
	Error      error
}

TranscodingError will hold the error information after transcoding process finished

func DoExtraction

func DoExtraction(movie *models.Movie, cfg *config.ServerConfig) (bool, []TranscodingError)

DoExtraction will do extract HLS files

func ExtractMovHLS

func ExtractMovHLS(movieFilePath, destDir, ffmpegPathBin string, reso []string) (bool, []TranscodingError)

ExtractMovHLS will generate HLS files

Jump to

Keyboard shortcuts

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