mirror of
https://github.com/xfrr/goffmpeg.git
synced 2025-10-05 07:56:49 +08:00
ffmpeg configure
models added transcode added
This commit is contained in:
35
transcoder/transcoder.go
Normal file
35
transcoder/transcoder.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package transcoder
|
||||
|
||||
import (
|
||||
//"fmt"
|
||||
//"os"
|
||||
"errors"
|
||||
"os"
|
||||
"goffmpeg/models"
|
||||
)
|
||||
|
||||
type Transcoder struct {
|
||||
Process *os.Process
|
||||
InputPath string
|
||||
OutputPath string
|
||||
MediaFile *models.Mediafile
|
||||
}
|
||||
|
||||
func New(inputPath *string) (*Transcoder, error) {
|
||||
transcoding := new(Transcoder)
|
||||
|
||||
if inputPath == nil {
|
||||
return nil, errors.New("error: transcoder.Initialize -> inputPath missing")
|
||||
}
|
||||
|
||||
transcoding.InputPath = *inputPath
|
||||
transcoding.MediaFile = new(models.Mediafile)
|
||||
|
||||
return transcoding, nil
|
||||
|
||||
}
|
||||
|
||||
func (t *Transcoder) SetBitRate(v *string) string {
|
||||
t.MediaFile.VideoBitRate = *v
|
||||
return t.MediaFile.VideoBitRate
|
||||
}
|
Reference in New Issue
Block a user