Skip to content

Library to easily get the ffprobe output of a given file

License

Notifications You must be signed in to change notification settings

sapsan4eg/go-ffprobe

This branch is 1 commit ahead of, 3 commits behind vansante/go-ffprobe:v2.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Насыров Юрий Ринатович
Nov 7, 2024
916aaa0 · Nov 7, 2024
May 30, 2024
May 31, 2024
Apr 27, 2020
Mar 6, 2019
Aug 20, 2021
Apr 27, 2020
Dec 19, 2018
Jun 21, 2020
May 31, 2024
May 31, 2024
Apr 27, 2020
Dec 19, 2018
Nov 7, 2024
Jun 24, 2022
Jun 24, 2022
Jun 3, 2023
Jun 24, 2022

Repository files navigation

go-ffprobe

Small library for executing an ffprobe process on a given file and getting an easy to use struct representing the returned ffprobe data.

Installation

go get gopkg.in/vansante/go-ffprobe.v2

Documentation

Take a look at the autogenerated documentation:

https://pkg.go.dev/gopkg.in/vansante/go-ffprobe.v2

Basic usage

To get a quick the quick data on a video file:

ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

data, err := ffprobe.ProbeURL(ctx, "/path/to/file.mp4")
if err != nil {
    log.Panicf("Error getting data: %v", err)
}

To get the ffprobe data for a video file that is accessible via HTTP, you can use the same command, but with an HTTP URL.

To get the data of a file you have an io.Reader for, use:

ctx, cancelFn := context.WithTimeout(context.Background(), 5*time.Second)
defer cancelFn()

fileReader, err := os.Open("/path/to/file.mp4")
if err != nil {
    log.Panicf("Error opening test file: %v", err)
}

data, err := ffprobe.ProbeReader(ctx, fileReader)
if err != nil {
    log.Panicf("Error getting data: %v", err)
}

About

Library to easily get the ffprobe output of a given file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 99.4%
  • Dockerfile 0.6%