refactor: add -i to ffmpeg ProbeCommand. make it more consistent with the DownsampleCommand
This commit is contained in:
@@ -25,7 +25,7 @@ type nd struct {
|
|||||||
EnableDownsampling bool `default:"false"`
|
EnableDownsampling bool `default:"false"`
|
||||||
MaxBitRate int `default:"0"`
|
MaxBitRate int `default:"0"`
|
||||||
DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"`
|
DownsampleCommand string `default:"ffmpeg -i %s -map 0:0 -b:a %bk -v 0 -f mp3 -"`
|
||||||
ProbeCommand string `default:"ffmpeg %s -f ffmetadata"`
|
ProbeCommand string `default:"ffmpeg -i %s -f ffmetadata"`
|
||||||
ScanInterval string `default:"1m"`
|
ScanInterval string `default:"1m"`
|
||||||
|
|
||||||
// DevFlags. These are used to enable/disable debugging and incomplete features
|
// DevFlags. These are used to enable/disable debugging and incomplete features
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ func ExtractAllMetadata(dirPath string) (map[string]*Metadata, error) {
|
|||||||
func probe(inputs []string) (map[string]*Metadata, error) {
|
func probe(inputs []string) (map[string]*Metadata, error) {
|
||||||
cmdLine, args := createProbeCommand(inputs)
|
cmdLine, args := createProbeCommand(inputs)
|
||||||
|
|
||||||
log.Trace("Executing command", "cmdLine", cmdLine, "args", args)
|
log.Trace("Executing command", "arg0", cmdLine, "args", args)
|
||||||
cmd := exec.Command(cmdLine, args...)
|
cmd := exec.Command(cmdLine, args...)
|
||||||
output, _ := cmd.CombinedOutput()
|
output, _ := cmd.CombinedOutput()
|
||||||
mds := map[string]*Metadata{}
|
mds := map[string]*Metadata{}
|
||||||
@@ -233,10 +233,15 @@ func createProbeCommand(inputs []string) (string, []string) {
|
|||||||
|
|
||||||
split := strings.Split(cmd, " ")
|
split := strings.Split(cmd, " ")
|
||||||
args := make([]string, 0)
|
args := make([]string, 0)
|
||||||
|
first := true
|
||||||
for _, s := range split {
|
for _, s := range split {
|
||||||
if s == "%s" {
|
if s == "%s" {
|
||||||
for _, inp := range inputs {
|
for _, inp := range inputs {
|
||||||
args = append(args, "-i", inp)
|
if !first {
|
||||||
|
args = append(args, "-i")
|
||||||
|
}
|
||||||
|
args = append(args, inp)
|
||||||
|
first = false
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user