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

Commit 1e51981

Browse files
committed
update
1 parent 2832aff commit 1e51981

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

ffmpeg/ffmpeg.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ func (t *Transcoder) Start(opts transcoder.Options) (<-chan transcoder.Progress,
132132
defer close(out)
133133
err = cmd.Wait()
134134
if err != nil {
135-
log.Printf("failed to transcoding (%s) with args (%s) with error %v", t.config.FfmpegBinPath, args, err)
135+
err = fmt.Errorf("failed to transcoding (%s) with args (%s) with error %w", t.config.FfmpegBinPath, args, err)
136+
log.Println(err)
137+
out <- &Progress{Error: err}
136138
}
137139
}()
138140
} else {

ffmpeg/progress.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ type Progress struct {
77
CurrentBitrate string
88
Progress float64
99
Speed string
10+
Error error
1011
}
1112

1213
// GetFramesProcessed ...
@@ -33,3 +34,8 @@ func (p Progress) GetProgress() float64 {
3334
func (p Progress) GetSpeed() string {
3435
return p.Speed
3536
}
37+
38+
// GetError ...
39+
func (p Progress) GetError() error {
40+
return p.Error
41+
}

progress.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ type Progress interface {
77
GetCurrentBitrate() string
88
GetProgress() float64
99
GetSpeed() string
10+
GetError() error
1011
}

0 commit comments

Comments
 (0)