Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/p4xx07/go-ffmpeg
Docs
https://github.com/p4xx07/go-ffmpeg
ffmpeg go
Last synced: 3 months ago
JSON representation
Docs
- Host: GitHub
- URL: https://github.com/p4xx07/go-ffmpeg
- Owner: p4xx07
- License: mit
- Created: 2023-01-20T10:10:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-04T10:31:03.000Z (8 months ago)
- Last Synced: 2024-08-07T23:47:25.730Z (6 months ago)
- Topics: ffmpeg, go
- Language: Go
- Homepage: https://paxx-rnd.github.io/go-ffmpeg/
- Size: 30.1 MB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go Ffmpeg
[![Go build](https://github.com/Paxx-RnD/go-ffmpeg/actions/workflows/go-build.yml/badge.svg)](https://github.com/Paxx-RnD/go-ffmpeg/actions/workflows/go-build.yml)
[![Go Test workflow](https://github.com/Paxx-RnD/go-ffmpeg/actions/workflows/go-test.yml/badge.svg)](https://github.com/Paxx-RnD/go-ffmpeg/actions/workflows/go-test.yml)## Install
```
go get github.com/Paxx-RnD/go-ffmpeg
```### Simple Example
```go
func main(){
headers := []string{
"-y",
"-hide_banner",
"-loglevel", "info",
}
configuration := configuration.NewConfiguration(
"usr/bin/ffmpeg",
"usr/bin/ffprobe",
false)
f := ffmpeg.NewFfmpeg(configuration, headers)
args := f.
Input("/path/to/video.mp4").
Output("/path/to/output.mp4").
Build()f.Run(args)
}
```
### Example with bitrate and codecs
```go
func main(){
headers := []string{
"-y",
"-hide_banner",
"-loglevel", "info",
}
configuration := configuration.NewConfiguration(
"usr/bin/ffmpeg",
"usr/bin/ffprobe",
false)
f := ffmpeg.NewFfmpeg(configuration, headers)args := f.
Input("/path/to/video.mp4").
BitrateVideo(common_bitrates.VideoBitrate100K).
BitrateAudio(common_bitrates.AudioBitrate128K).
CodecVideo(codec_video.LIBX264).
CodecAudio(codec_audio.AAC).
Output("/path/to/output.mp4").
Build()f.Run(args)
}
```
### Example with Filter Complex
```go
func main(){
headers := []string{
"-y",
"-hide_banner",
"-loglevel", "info",
}
configuration := configuration.NewConfiguration(
"usr/bin/ffmpeg",
"usr/bin/ffprobe",
false)
f := ffmpeg.NewFfmpeg(configuration, headers)args := f.
Input("/path/to/video.mp4").
CodecVideo(codec_video.LIBX264).
CodecAudio(codec_audio.AAC).
FilterGraph().
Fps("0:v", 15, "fps1").
Scale("fps1", 100, 100, "scale").
Map("scale").
Output("/path/to/output.mp4").
Build()
f.Run(args)
}
```