Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit c9ef797

Browse files
committed
update
1 parent ef1aff3 commit c9ef797

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ffmpeg/ffmpeg.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
135135
defer close(out)
136136
err = cmd.Wait()
137137
if err != nil {
138-
err = fmt.Errorf("failed to transcoding (%s) with args (%s) with error %w", t.config.FfmpegBinPath, args, err)
138+
b, _ := io.ReadAll(io.LimitReader(stderrIn, 100))
139+
err = fmt.Errorf("failed to transcoding (%s) with args (%s) with error %w: %s", t.config.FfmpegBinPath, args, err, string(b))
139140
log.Println(err)
140141
out <- &Progress{Error: err}
141142
}
@@ -144,7 +145,8 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
144145
} else {
145146
err = cmd.Wait()
146147
if err != nil {
147-
return nil, fmt.Errorf("failed to transcoding (%s) with args (%s) with error %w", t.config.FfmpegBinPath, args, err)
148+
b, _ := io.ReadAll(io.LimitReader(stderrIn, 100))
149+
return nil, fmt.Errorf("failed to transcoding (%s) with args (%s) with error %w: %s", t.config.FfmpegBinPath, args, err, string(b))
148150
}
149151
}
150152

0 commit comments

Comments
 (0)