mirror of
https://github.com/xfrr/goffmpeg.git
synced 2025-09-26 20:11:19 +08:00
d1ffcda9088707e294619965afd9db7f352a75a1
Goffmpeg
FFMPEG wrapper written in GO
Dependencies
Supported platforms
- Linux
- OS X
- Windows not supported yet
Getting started
How to transcode a media file
package main
import (
"goffmpeg/transcoder"
)
var inputPath = "/data/testmov"
var outputPath = "/data/testmp4.mp4"
func main() {
// Create new instance of transcoder
trans := new(transcoder.Transcoder)
// Initialize transcoder passing the input file path and output file path
err := trans.Initialize( inputPath, outputPath )
// Handle error...
// Start transcoder process
done, err := trans.Run()
// This channel is used to wait for the process to end
<-done
}
How to get the transcoding progress
...
func main() {
// Create new instance of transcoder
trans := new(transcoder.Transcoder)
// Initialize transcoder passing the input file path and output file path
err := trans.Initialize( inputPath, outputPath )
// Handle error...
// Start transcoder process
done, err := trans.Run()
// Returns a channel to get the transcoding progress
progress, err := trans.Output()
// Example of printing transcoding progress
for msg := range progress {
fmt.Println(msg)
}
// This channel is used to wait for the transcoding process to end
<-done
}
Manipulating media file
Building
Languages
Go
99.7%
Makefile
0.3%