mediainfo

package
v0.0.0-...-0fe5c75 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2019 License: AGPL-3.0 Imports: 4 Imported by: 1

README

creamy-transcode/mediainfo

Extract media information from locally-stored videos.

Usage

package main

import (
	"github.com/AlbinoDrought/creamy-transcode/mediainfo"
	"github.com/davecgh/go-spew/spew"
)

func main() {
	result, _ := mediainfo.IdentifyFile("./mediainfo/ffprobe/test_fixtures/doggo_waddling.mp4")

	spew.Dump(result)
}

// output:
/*
(mediainfo.MediaInfo) {
 MimeType: (string) (len=9) "video/mp4",
 Size: (int64) 204141,
 Width: (int) 640,
 Height: (int) 360,
 AspectRatio: (string) (len=4) "16:9",
 FPS: (string) (len=14) "3823232/127989",
 VideoBitrate: (string) (len=6) "276883",
 IsHD: (bool) false,
 IsAudioOnly: (bool) false,
 Duration: (string) (len=8) "4.285011",
 VideoCodec: (string) (len=4) "h264",
 AudioCodec: (string) (len=3) "aac",
 Channels: (int) 2,
 AudioBitrate: (string) (len=5) "95999",
 SampleRate: (string) (len=5) "44100"
}
*/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MediaInfo

type MediaInfo struct {
	MimeType     string
	Size         int64
	Width        int
	Height       int
	AspectRatio  string
	FPS          string
	VideoBitrate string
	IsHD         bool
	IsAudioOnly  bool
	Duration     string
	VideoCodec   string
	AudioCodec   string
	Channels     int
	AudioBitrate string
	SampleRate   string
}

MediaInfo represents metadata of a media file and includes information about video and audio streams

func IdentifyFile

func IdentifyFile(path string) (MediaInfo, error)

IdentifyFile parses metadata from a local file into easy-to-consume MediaInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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