Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xfrr authored Feb 6, 2018
1 parent aa676ed commit f0a8e50
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 @@ -19,18 +19,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,26 +40,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 f0a8e50

Please sign in to comment.