Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floostack/transcoder
Transcoding library implementation in Golang
https://github.com/floostack/transcoder
ffmpeg golang golang-library transcoding
Last synced: 2 months ago
JSON representation
Transcoding library implementation in Golang
- Host: GitHub
- URL: https://github.com/floostack/transcoder
- Owner: floostack
- License: mit
- Archived: true
- Created: 2020-06-24T16:44:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-29T16:45:20.000Z (over 1 year ago)
- Last Synced: 2024-11-15T15:02:29.863Z (3 months ago)
- Topics: ffmpeg, golang, golang-library, transcoding
- Language: Go
- Homepage:
- Size: 26.4 KB
- Stars: 270
- Watchers: 8
- Forks: 74
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Golang Transcoding Library
> This repository is no longer maintained. Please use [Goffmpeg](https://github.com/xfrr/goffmpeg).
## Features
- Ease use
- Implement your own business logic around easy interfaces
- Transcoding progress
- Obtain progress events generated by transcoding application process
## Download from Github
```shell
go get github.com/floostack/transcoder
```
## Example
```go
package main
import (
"log"
ffmpeg "github.com/floostack/transcoder/ffmpeg"
)
func main() {
hwaccel := "cuvid"
videoCodec := "h264_cuvid"
inputOpts := ffmpeg.Options{
Hwaccel: &hwaccel,
VideoCodec: &videoCodec,
}
format := "mp4"
overwrite := true
outputOpts := ffmpeg.Options{
OutputFormat: &format,
Overwrite: &overwrite,
}
ffmpegConf := &ffmpeg.Config{
FfmpegBinPath: "/usr/local/bin/ffmpeg",
FfprobeBinPath: "/usr/local/bin/ffprobe",
ProgressEnabled: true,
}
progress, err := ffmpeg.
New(ffmpegConf).
Input("/tmp/avi").
Output("/tmp/mp4").
WithInputOptions(inputOpts).
WithOutputOptions(outputOpts).
Start()
if err != nil {
log.Fatal(err)
}
for msg := range progress {
log.Printf("%+v", msg)
}
}
```