Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zhulik/Go_mediainfo
Golang bindings for libmediainfo
https://github.com/zhulik/Go_mediainfo
Last synced: 18 days ago
JSON representation
Golang bindings for libmediainfo
- Host: GitHub
- URL: https://github.com/zhulik/Go_mediainfo
- Owner: zhulik
- License: mit
- Archived: true
- Created: 2015-12-13T22:23:23.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-24T20:40:36.000Z (almost 9 years ago)
- Last Synced: 2024-07-31T01:22:31.492Z (3 months ago)
- Language: Go
- Homepage:
- Size: 361 KB
- Stars: 38
- Watchers: 2
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mediainfo
Golang binding for [libmediainfo](https://mediaarea.net/en/MediaInfo)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](https://mediaarea.net/en/MediaInfo/Support/SDK).
Your advices and suggestions are welcome!
## Example
```go
package mainimport (
"fmt"
"github.com/zhulik/go_mediainfo"
"io/ioutil"
"os"
)func main() {
f, err := os.Open(os.Args[1])
if err != nil {
panic(err)
}
bytes, err := ioutil.ReadAll(f)
if err != nil {
panic(err)
}mi := mediainfo.NewMediaInfo()
err = mi.OpenMemory(bytes)
if err != nil {
panic(err)
}
fmt.Println(mi.AvailableParameters()) // Print all supported params for Get
fmt.Println(mi.Get("BitRate")) // Print bitrate
}```
Read the [documentation](https://godoc.org/github.com/zhulik/go_mediainfo) for other functions
## Contributing
You know=)