transcoder
transcoder copied to clipboard
Metadata example
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"
Same here, plus there's stuff not considered (thus not being parsed) like the language of the streams.