Skip to content

zelenin/go-mediainfo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

go-mediainfo

Go bindings for MediaInfo

Dependencies

ubuntu 18.04

sudo apt-get install libmediainfo0v5 libmediainfo-dev

Usage

Open file

file, err := mediainfo.Open("/file/path/filename.mp4")
if err != nil {
    log.Fatal(err)
}
defer file.Close()

Bitrate

videoBitrate := file.Parameter(mediainfo.StreamVideo, 0, "BitRate")
audioBitrateTrack1 := file.Parameter(mediainfo.StreamAudio, 0, "BitRate")
audioBitrateTrack2 := file.Parameter(mediainfo.StreamAudio, 1, "BitRate")

Stream count

audioTracks := file.Parameter(mediainfo.StreamAudio, 0, "StreamCount")

Available parameters

parameters := file.Option("info_parameters", "")

Author

Aleksandr Zelenin, e-mail: [email protected]