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

Transcoding progress doesn't show up #18

Open
@hcbt

Description

@hcbt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions