mirror of
https://github.com/fxkt-tech/liv
synced 2025-09-26 20:11:20 +08:00
80 lines
1.7 KiB
Go
80 lines
1.7 KiB
Go
package liv
|
|
|
|
type TranscodeSpec struct{}
|
|
|
|
func NewTranscodeSpec() *TranscodeSpec {
|
|
return &TranscodeSpec{}
|
|
}
|
|
|
|
func (*TranscodeSpec) SimpleMP4Satified(params *TranscodeParams) error {
|
|
if params == nil || len(params.Subs) == 0 {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) SimpleMP3Satified(params *TranscodeParams) error {
|
|
if params == nil || len(params.Subs) == 0 {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) SimpleJPEGSatified(params *TranscodeParams) error {
|
|
if params == nil || len(params.Subs) == 0 {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) ConvertContainerSatified(params *ConvertContainerParams) error {
|
|
if params == nil || params.InFile == "" || params.OutFile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) SimpleHLSSatified(params *TranscodeSimpleHLSParams) error {
|
|
if params == nil || params.Infile == "" || params.Outfile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) SimpleTSSatified(params *TranscodeSimpleTSParams) error {
|
|
if params == nil || params.Infile == "" || params.Outfile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) ConcatSatified(params *ConcatParams) error {
|
|
if params == nil || len(params.Infiles) == 0 || params.Outfile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) ExtractAudioSatified(params *ExtractAudioParams) error {
|
|
if params == nil || params.Infile == "" || params.Outfile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (*TranscodeSpec) MergeByFramesSatified(params *MergeParams) error {
|
|
if params == nil ||
|
|
params.FramesInfile == "" ||
|
|
params.AudioInfile == "" ||
|
|
params.Outfile == "" {
|
|
return ErrParamsInvalid
|
|
}
|
|
return nil
|
|
}
|