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 27, 2018
2 parents 2e2a6c7 + 13d0a0f commit d1ffcda
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Goffmpeg
# Goffmpeg
FFMPEG wrapper written in GO


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

# Supported platforms

- Linux
- OS X
- **Windows not supported yet**

# Getting started
How to transcode a media file
```go
Expand All @@ -19,18 +25,19 @@ var outputPath = "/data/testmp4.mp4"

func main() {

// Create new instance of transcoder
// Create new instance of transcoder
trans := new(transcoder.Transcoder)

// Initialize transcoder passing the input file path and output file path
// 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()
// Start transcoder process
done, err := trans.Run()

// This channel is used to wait for the process to end
<-done
// This channel is used to wait for the process to end
<-done

}
```
Expand All @@ -39,28 +46,29 @@ How to get the transcoding progress
...
func main() {

// Create new instance of transcoder
// Create new instance of transcoder
trans := new(transcoder.Transcoder)

// Initialize transcoder passing the input file path and output file path
// 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()
// Start transcoder process
done, err := trans.Run()

// Returns a channel to get the transcoding progress
progress, err := trans.Output()
// Returns a channel to get the transcoding progress
progress, err := trans.Output()

// Example of printing transcoding progress
for msg := range progress {
fmt.Println(msg)
}
// 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
// This channel is used to wait for the transcoding process to end
<-done

}
```
Manipulating media file
> Building
> Building

0 comments on commit d1ffcda

Please sign in to comment.