av/cmd/basic-driver/main.go

32 lines
748 B
Go
Raw Normal View History

2018-03-17 16:29:42 +03:00
package main
import (
"fmt"
"time"
2018-05-30 10:19:13 +03:00
"bitbucket.org/ausocean/av/revid"
2018-03-17 16:29:42 +03:00
)
func main() {
2018-04-15 13:53:53 +03:00
// Give the platform some time to set itself up
2018-03-17 16:29:42 +03:00
time.Sleep(30 * time.Second)
config := revid.Config{
Input: revid.Raspivid,
2018-04-19 12:03:54 +03:00
Output: revid.NativeRtmp,
2018-03-17 16:29:42 +03:00
QuantizationMode: revid.QuantizationOff,
2016-11-04 00:40:58 +03:00
RtmpUrl: "rtmp://a.rtmp.youtube.com/live2/xt13-r4dh-f2w1-bh4s",
2018-03-17 16:29:42 +03:00
Bitrate: "500000",
Packetization: revid.Flv,
}
2018-04-16 08:17:50 +03:00
revidInst, err := revid.NewRevid(config)
2018-03-17 16:29:42 +03:00
if err != nil {
fmt.Println("Should not have got error!")
return
}
2018-04-15 13:53:53 +03:00
// Run this instance for 2 days! Power to the pi will surely turn itself
// off before this time is up.
2018-03-17 16:29:42 +03:00
revidInst.Start()
time.Sleep(2 * 43200 * time.Second)
revidInst.Stop()
}