Skip to content
This repository was archived by the owner on Nov 16, 2022. It is now read-only.

zhulik/go_mediainfo

Repository files navigation

mediainfo

Golang binding for libmediainfo

Duration, Bitrate, Codec, Streams and a lot of other meta-information about media files can be extracted through it.

For now supports only media files with one stream. Bindings for MediaInfoList is not provided. It can be easy fixed if anybody ask me.

Works through MediaInfoDLL/MediaInfoDLL.h(dynamic load and so on), so your mediainfo installation should has it.

Supports direct reading files by name and reading data from []byte buffers(without copying it for C calls).

Documentation for libmediainfo is poor and ascetic, can be found here.

Your advices and suggestions are welcome!

Example

package main import ( "fmt""github.com/zhulik/go_mediainfo""io/ioutil""os" ) funcmain(){f, err:=os.Open(os.Args[1]) iferr!=nil{panic(err) } bytes, err:=ioutil.ReadAll(f) iferr!=nil{panic(err) } mi:=mediainfo.NewMediaInfo() err=mi.OpenMemory(bytes) iferr!=nil{panic(err) } fmt.Println(mi.AvailableParameters()) // Print all supported params for Getfmt.Println(mi.Get("BitRate")) // Print bitrate }

Read the documentation for other functions

Contributing

You know=)

About

Golang bindings for libmediainfo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages