transcoder
transcoder copied to clipboard
Transcoding progress doesn't show up
Hello, I was following example given in the readme file but it does not output any progress, other than that it works fine. My function looks like that:
//ConvertAudio - converts dowloaded youtube video to .wav
func ConvertAudio(inputfilename string, videoID string) (string, error){
format := "wav"
overwrite := true
outputfilename := videoID + ".wav"
opts := ffmpeg.Options{
OutputFormat: &format,
Overwrite: &overwrite,
}
ffmpegConf := &ffmpeg.Config{
FfmpegBinPath: "/usr/local/bin/ffmpeg",
FfprobeBinPath: "/usr/local/bin/ffprobe",
ProgressEnabled: true,
}
progress, err := ffmpeg.
New(ffmpegConf).
Input(inputfilename).
Output(outputfilename).
WithOptions(opts).
Start(opts)
if err != nil {
return outputfilename, err
}
for msg := range progress {
log.Printf("%+v", msg)
}
err = os.Remove(inputfilename)
if err != nil {
return outputfilename, err
}
return outputfilename, nil
}
Running this on Mac Os Big Sur, go 1.15 and github.com/floostack/transcoder v1.1.1.