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 0365d6c + f0a8e50 commit 13d0a0f
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,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 @@ -45,26 +46,27 @@ 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

}
```
Expand Down

0 comments on commit 13d0a0f

Please sign in to comment.