Skip to content
/ mp4 Public

🎥 Basic MP4 reader in Go! CLI + Golang Package for ISO/IEC 14496-12 - ISO Base Media File Format

License

Notifications You must be signed in to change notification settings

alfg/mp4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

55ea58c · Jul 28, 2021

History

58 Commits
Jul 28, 2021
Jul 28, 2021
Feb 20, 2021
Aug 19, 2018
Sep 12, 2018
Feb 20, 2021
Oct 1, 2018
Jan 28, 2020
Sep 17, 2020
Sep 21, 2018
Dec 31, 2019
Jul 28, 2021
Sep 17, 2020

Repository files navigation

MP4

Basic MP4 reader in Go!

CLI and library for ISO/IEC 14496-12 - ISO Base Media File Format

https://godoc.org/github.com/alfg/mp4

Build Status Build status GoDoc Go Report Card

Usage

go get -u github.com/alfg/mp4
package main

import (
    "fmt"
    "os"
    "github.com/alfg/mp4"
)

func main() {
    file, err := os.Open("test/tears-of-steel.mp4")
    if err != nil {
        panic(err)
    }
    defer file.Close()

    info, err := file.Stat()
    if err != nil {
        panic(err)
    }
    size := info.Size()

    mp4, _ := mp4.OpenFromReader(file, size)
    file.Close()
    fmt.Println(file.Ftyp.Name)
    fmt.Println(file.Ftyp.MajorBrand)
}

See examples/ for more examples.

Develop

git clone https://github.com/alfg/mp4.git
go run example\example.go

Or build the CLI:

go build -o mp4info cmd\mp4info\mp4info.go
mp4info -i test\tears-of-steel.mp4

Documentation

License

MIT