mirror of
https://github.com/xfrr/goffmpeg.git
synced 2025-10-05 14:46:51 +08:00
Go Gettable, Setting output path also from mediafile
This commit is contained in:
@@ -3,11 +3,11 @@ package transcoder
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"goffmpeg/models"
|
||||
"github.com/xfrr/goffmpeg/models"
|
||||
"os/exec"
|
||||
"fmt"
|
||||
"goffmpeg/ffmpeg"
|
||||
"goffmpeg/utils"
|
||||
"github.com/xfrr/goffmpeg/ffmpeg"
|
||||
"github.com/xfrr/goffmpeg/utils"
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"bufio"
|
||||
@@ -18,7 +18,6 @@ import (
|
||||
|
||||
type Transcoder struct {
|
||||
process *exec.Cmd
|
||||
outputPath string
|
||||
mediafile *models.Mediafile
|
||||
configuration ffmpeg.Configuration
|
||||
}
|
||||
@@ -27,10 +26,6 @@ func (t *Transcoder) SetProccess(v *exec.Cmd) {
|
||||
t.process = v
|
||||
}
|
||||
|
||||
func (t *Transcoder) SetOutputPath(v string) {
|
||||
t.outputPath = v
|
||||
}
|
||||
|
||||
func (t *Transcoder) SetMediaFile(v *models.Mediafile) {
|
||||
t.mediafile = v
|
||||
}
|
||||
@@ -45,10 +40,6 @@ func (t Transcoder) Process() *exec.Cmd {
|
||||
return t.process
|
||||
}
|
||||
|
||||
func (t Transcoder) OutputPath() string {
|
||||
return t.outputPath
|
||||
}
|
||||
|
||||
func (t Transcoder) MediaFile() *models.Mediafile {
|
||||
return t.mediafile
|
||||
}
|
||||
@@ -70,8 +61,6 @@ func (t Transcoder) GetCommand() string {
|
||||
|
||||
rcommand += media.ToStrCommand()
|
||||
|
||||
rcommand += " \"" + t.outputPath + "\""
|
||||
|
||||
return rcommand
|
||||
|
||||
}
|
||||
@@ -126,9 +115,9 @@ func (t *Transcoder) Initialize(inputPath string, outputPath string) (error) {
|
||||
MediaFile := new(models.Mediafile)
|
||||
MediaFile.SetMetadata(Metadata)
|
||||
MediaFile.SetInputPath(inputPath)
|
||||
MediaFile.SetOutputPath(outputPath)
|
||||
// Set transcoder configuration
|
||||
|
||||
t.SetOutputPath(outputPath)
|
||||
t.SetMediaFile(MediaFile)
|
||||
t.SetConfiguration(configuration)
|
||||
|
||||
|
Reference in New Issue
Block a user