From 3a60494fcaa11dd0543cb25c6c938d27386ffbe1 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Tue, 9 Dec 2025 01:50:10 -0500 Subject: [PATCH] Include FFmpeg stderr in snippet job errors --- main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index b4e496b..4312a27 100644 --- a/main.go +++ b/main.go @@ -2182,12 +2182,13 @@ func (s *appState) executeSnippetJob(ctx context.Context, job *queue.Job, progre cmd := exec.CommandContext(ctx, platformConfig.FFmpegPath, args...) utils.ApplyNoWindow(cmd) - if err := cmd.Run(); err != nil { + out, err := cmd.CombinedOutput() + if err != nil { if logFile != nil { - fmt.Fprintf(logFile, "\nStatus: failed at %s\nError: %v\n", time.Now().Format(time.RFC3339), err) + fmt.Fprintf(logFile, "\nStatus: failed at %s\nError: %v\nFFmpeg output:\n%s\n", time.Now().Format(time.RFC3339), err, string(out)) _ = logFile.Close() } - return err + return fmt.Errorf("snippet failed: %w\nffmpeg output:\n%s", err, string(out)) } if logFile != nil { fmt.Fprintf(logFile, "\nStatus: completed at %s\n", time.Now().Format(time.RFC3339))