From 77425b96e03a10da7c067a75023841ce4989e05c Mon Sep 17 00:00:00 2001 From: murphysking Date: Mon, 13 May 2024 16:29:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=AF=E7=94=A8convert=5Fto=5Fmp4=E6=97=B6?= =?UTF-8?q?=E5=8E=BB=E9=99=A4=E5=8E=9F=E5=A7=8B=E5=90=8E=E7=BC=80=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/recorders/recorder.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/recorders/recorder.go b/src/recorders/recorder.go index d7910a92..0753d0ba 100644 --- a/src/recorders/recorder.go +++ b/src/recorders/recorder.go @@ -214,6 +214,8 @@ func (r *recorder) tryRecord(ctx context.Context) { } r.getLogger().Debugf("end executing custom_commandline: %s", args[1]) } else if r.config.OnRecordFinished.ConvertToMp4 { + //格式转换时去除原本后缀名 + newFileName := fileName[0:strings.LastIndex(fileName, ".")] convertCmd := exec.Command( ffmpegPath, "-hide_banner", @@ -221,7 +223,7 @@ func (r *recorder) tryRecord(ctx context.Context) { fileName, "-c", "copy", - fileName+".mp4", + newFileName+".mp4", ) if err = convertCmd.Run(); err != nil { convertCmd.Process.Kill()