Transcoder.Output() doesn't output progress
falzm opened this issue ยท 7 comments
Hi ๐
I'm trying to write a small utility that resizes video files while reporting the progress of the transcoding, so using your package I wrote this snippet that works (i.e. the file transcoding works), but no output is streamed from channel returned by the Transcoder.Output()
method:
package main
import (
"fmt"
"github.com/xfrr/goffmpeg/transcoder"
)
var inputPath = "test.mkv"
var outputPath = "test.res.mkv"
func main() {
trans := new(transcoder.Transcoder)
err := trans.Initialize(inputPath, outputPath)
if err != nil {
panic(err)
}
trans.MediaFile().SetAudioCodec("copy")
trans.MediaFile().SetVideoCodec("libx264")
trans.MediaFile().SetVideoFilter("scale=854:480")
trans.MediaFile().SetCRF(18)
trans.MediaFile().SetPreset("veryslow")
done := trans.Run(true)
for msg := range trans.Output() {
fmt.Println(msg) // <- Nothing printed out here
}
if err = <-done; err != nil {
panic(err)
}
}
I did a bit of digging, and it seems that bufio.Scanner()
gets stuck here (no iteration in the loop).
I'm running ffmpeg 4.2.2 on macOS and Go 1.14.0, let me know if you need more information.
Problem seem to be caused by this line:
goffmpeg/transcoder/transcoder.go
Line 227 in 372fcc3
I created a pull request removing the line. Errors do still seem to be printed - and it's not like the current code handles these errb in any way. I tried to use it without the line and it very much does work as I would expect it to.
Thanks @manscrober!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
wontfix
, seriously?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.