File tree Expand file tree Collapse file tree 1 file changed +40
-3
lines changed Expand file tree Collapse file tree 1 file changed +40
-3
lines changed Original file line number Diff line number Diff line change 1
- # FLOOTIC UI
1
+ # Golang Transcoding Library
2
2
3
3
<br />
4
4
36
36
go get github.com/floostack/go-transcoder
37
37
```
38
38
39
- ## Initialize Transcoder
40
- Transcoding process requires the following parameters to work
39
+ ## Example
41
40
42
41
``` go
42
+ package main
43
43
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
+ }
44
81
```
You can’t perform that action at this time.
0 commit comments