Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 63dbe5c

Browse files
committed
fixed readme
1 parent a9e0b17 commit 63dbe5c

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# FLOOTIC UI
1+
# Golang Transcoding Library
22

33
<br />
44

@@ -36,9 +36,46 @@
3636
go get github.com/floostack/go-transcoder
3737
```
3838

39-
## Initialize Transcoder
40-
Transcoding process requires the following parameters to work
39+
## Example
4140

4241
```go
42+
package main
4343

44+
import (
45+
"log"
46+
47+
ffmpeg "github.com/floostack/gotrans/ffmpeg"
48+
)
49+
50+
func main() {
51+
52+
format := "mp4"
53+
overwrite := true
54+
55+
opts := ffmpeg.Options{
56+
OutputFormat: &format,
57+
Overwrite: &overwrite,
58+
}
59+
60+
ffmpegConf := &ffmpeg.Config{
61+
FfmpegBinPath: "/usr/local/bin/ffmpeg",
62+
FfprobeBinPath: "/usr/local/bin/ffprobe",
63+
ProgressEnabled: true,
64+
}
65+
66+
progress, err := ffmpeg.
67+
New(ffmpegConf).
68+
Input("/tmp/avi").
69+
Output("/tmp/mp4").
70+
WithOptions(opts).
71+
Start(opts)
72+
73+
if err != nil {
74+
log.Fatal(err)
75+
}
76+
77+
for msg := range progress {
78+
log.Printf("%+v", msg)
79+
}
80+
}
4481
```

0 commit comments

Comments
 (0)