https://github.com/vansante/go-ffprobe
Library to easily get the ffprobe output of a given file
https://github.com/vansante/go-ffprobe
ffmpeg ffmpeg-wrapper ffprobe go golang golang-library
Last synced: 2 months ago
JSON representation
Library to easily get the ffprobe output of a given file
- Host: GitHub
- URL: https://github.com/vansante/go-ffprobe
- Owner: vansante
- License: mit
- Created: 2017-05-02T11:29:39.000Z (about 8 years ago)
- Default Branch: v2
- Last Pushed: 2024-12-11T07:41:27.000Z (7 months ago)
- Last Synced: 2025-04-12T14:16:12.369Z (3 months ago)
- Topics: ffmpeg, ffmpeg-wrapper, ffprobe, go, golang, golang-library
- Language: Go
- Size: 8.47 MB
- Stars: 194
- Watchers: 4
- Forks: 50
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```golang
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:
```golang
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)
}
```