mp4

package module
v0.0.0-...-55ea58c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 4 Imported by: 10

README

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(path string) (f *atom.Mp4Reader, err error)

Open opens a file and returns an &Mp4Reader{}.

func OpenFromBytes

func OpenFromBytes(buffer []byte) (f *atom.Mp4Reader, err error)

OpenFromBytes read and returns an &Mp4Reader{}.

func OpenFromReader

func OpenFromReader(reader io.ReaderAt, size int64) (f *atom.Mp4Reader, err error)

OpenFromReader read and returns an &Mp4Reader{}.

Types

This section is empty.

Directories

Path Synopsis
cmd
examples

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL