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

Commit ef1aff3

Browse files
committed
update
1 parent 4392c5a commit ef1aff3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

ffmpeg/ffmpeg.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ func (t *Transcoder) GetMetadata() (transcoder.Metadata, error) {
283283
return nil, errors.New("ffprobe binary not found")
284284
}
285285

286+
var reEQ = regexp.MustCompile(`=\s+`)
287+
286288
// progress sends through given channel the transcoding status
287289
func (t *Transcoder) progress(stream io.ReadCloser, out chan transcoder.Progress) {
288290

@@ -318,11 +320,8 @@ func (t *Transcoder) progress(stream io.ReadCloser, out chan transcoder.Progress
318320
line := scanner.Text()
319321

320322
if strings.Contains(line, "time=") && strings.Contains(line, "bitrate=") {
321-
var re = regexp.MustCompile(`=\s+`)
322-
st := re.ReplaceAllString(line, `=`)
323-
323+
st := reEQ.ReplaceAllString(line, `=`)
324324
f := strings.Fields(st)
325-
326325
var framesProcessed string
327326
var currentTime string
328327
var currentBitrate string

0 commit comments

Comments
 (0)