From 1070b796cc0013c5b669e1432e097e7c7dce3575 Mon Sep 17 00:00:00 2001 From: Leonid Nikitin Date: Tue, 16 Jan 2024 00:15:45 +0600 Subject: [PATCH] Fix RunConvert. Fixed an error converting videos with a file name that has spaces. --- src/convertor/service.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/convertor/service.go b/src/convertor/service.go index 41c05cb..424b0a4 100644 --- a/src/convertor/service.go +++ b/src/convertor/service.go @@ -46,8 +46,9 @@ func (s Service) RunConvert(setting ConvertSetting) error { //args = append(args, "-progress", "unix://"+setting.SocketPath, "-i", setting.VideoFileInput.Path, "file-out.mp4") //args := "-report -n -i " + setting.VideoFileInput.Path + " -c:v libx264 -progress unix://" + setting.SocketPath + " output-file.mp4" //args := "-n -i " + setting.VideoFileInput.Path + " -c:v libx264 -progress unix://" + setting.SocketPath + " output-file.mp4" - args := "-y -i " + setting.VideoFileInput.Path + " -c:v libx264 -progress unix://" + setting.SocketPath + " output-file.mp4" - cmd := exec.Command(s.pathFFmpeg, strings.Split(args, " ")...) + //args := "-y -i " + setting.VideoFileInput.Path + " -c:v libx264 -progress unix://" + setting.SocketPath + " output-file.mp4" + args := []string{"-y", "-i", setting.VideoFileInput.Path, "-c:v", "libx264", "-progress", "unix://" + setting.SocketPath, "output-file.mp4"} + cmd := exec.Command(s.pathFFmpeg, args...) out, err := cmd.CombinedOutput() if err != nil {