Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/xfrr/goffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
frr committed Feb 5, 2018
2 parents b7ba6cc + e19a7ef commit aa676ed
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,66 @@
# goffmpeg
# Goffmpeg
FFMPEG wrapper written in GO

> Building

# Dependencies
- [FFmpeg](https://www.ffmpeg.org/)

# Getting started
How to transcode a media file
```go
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
```go
...
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

0 comments on commit aa676ed

Please sign in to comment.