mirror of https://bitbucket.org/ausocean/av.git
32 lines
787 B
Go
32 lines
787 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"bitbucket.org/ausocean/av/revid"
|
||
|
"fmt"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
// Give the platform some time to set itself up
|
||
|
time.Sleep(30 * time.Second)
|
||
|
config := revid.Config{
|
||
|
Input: revid.Raspivid,
|
||
|
Output: revid.Rtmp,
|
||
|
RtmpMethod: revid.LibRtmp,
|
||
|
QuantizationMode: revid.QuantizationOff,
|
||
|
RtmpUrl: "rtmp://a.rtmp.youtube.com/live2/w44c-mkuu-aezg-ceb1",
|
||
|
Bitrate: "500000",
|
||
|
Packetization: revid.Flv,
|
||
|
}
|
||
|
revidInst, err := revid.NewRevidInstance(config)
|
||
|
if err != nil {
|
||
|
fmt.Println("Should not have got error!")
|
||
|
return
|
||
|
}
|
||
|
// Run this instance for 2 days! Power to the pi will surely turn itself
|
||
|
// off before this time is up.
|
||
|
revidInst.Start()
|
||
|
time.Sleep(2 * 43200 * time.Second)
|
||
|
revidInst.Stop()
|
||
|
}
|