diff --git a/util/ffmpeg.go b/util/ffmpeg.go index e2b311a..629b4dd 100644 --- a/util/ffmpeg.go +++ b/util/ffmpeg.go @@ -331,13 +331,12 @@ func QuickVideoCut(ctx context.Context, inputFile string, offset, length float64 FfmpegExec, "-hide_banner", "-y", + "-ss", strconv.FormatFloat(offset, 'f', 2, 64), "-i", inputFile, "-f", "lavfi", "-i", "anullsrc=channel_layout=mono:sample_rate=44100", "-c:v", "copy", "-c:a", "aac", "-shortest", - "-reset_timestamps", "1", - "-ss", strconv.FormatFloat(offset, 'f', 2, 64), "-t", strconv.FormatFloat(length, 'f', 2, 64), "-fflags", "+genpts", "-f", "mp4", @@ -376,13 +375,14 @@ func QuickConcatVideoCut(ctx context.Context, inputFiles []dto.File, offset, len "-y", "-f", "concat", "-safe", "0", + "-ss", strconv.FormatFloat(offset, 'f', 2, 64), "-i", tmpFile, "-f", "lavfi", "-i", "anullsrc=channel_layout=mono:sample_rate=44100", "-c:v", "copy", "-c:a", "aac", "-shortest", - "-ss", strconv.FormatFloat(offset, 'f', 2, 64), "-t", strconv.FormatFloat(length, 'f', 2, 64), + "-fflags", "+genpts", "-f", "mp4", outputFile, }