transcoder icon indicating copy to clipboard operation
transcoder copied to clipboard

Metadata example

Open fouadkada opened this issue 3 years ago • 1 comments

Is it possible to have a working example on how to use metadata, especially the duration. While testing this module, I get an empty string for duration.

	transcoder := ffmpeg.New(ffmpegConf).Input(in)

	metadata, err := transcoder.GetMetadata()
	if err != nil {
		return err
	}
	duration := metadata.GetFormat().GetDuration()
	fmt.Println(duration)

	_, err = transcoder.
		Output(out).
		WithOptions(opts).
		Start(opts)
	 
        if err != nil {
		return err
	}

why is the duration an empty string? and how to fix it?

FWIW the input parameter is a file path something like "/tmp/jfkldflas.webm"

fouadkada avatar Apr 14 '21 15:04 fouadkada

Same here, plus there's stuff not considered (thus not being parsed) like the language of the streams.

elboletaire avatar Oct 10 '22 17:10 elboletaire