1 Star 1 Fork 0

wulala乌啦啦 / hwpack

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
example.go 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"fmt"
"time"
"gitee.com/wulalade/hwpack/gst"
)
func main() {
fmt.Println("gst_demo")
//pipeline, err := gst.ParseLaunch("nvarguscamerasrc sensor-id=0 ! queue ! videoconvert ! omxh264enc ! h264parse ! flvmux ! fakesink")
//pipeline, err := gst.ParseLaunch("nvarguscamerasrc sensor-id=0 ! queue ! videoconvert ! omxh264enc ! h264parse ! flvmux ! rtmpsink sync=false location=rtmp://127.0.0.1/live/livestream")
//pipeline, err := gst.ParseLaunch("nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)320, height=(int)240, format=(string)NV12,framerate=(fraction)20/1 ! queue ! videoconvert ! omxh264enc ! h264parse ! flvmux ! rtmpsink sync=false location=\"rtmp://127.0.0.1/live/livestream\"")
pipeline, err := gst.ParseLaunch("nvarguscamerasrc ! video/x-raw(memory:NVMM), width=(int)1024, height=(int)768, format=(string)NV12,framerate=(fraction)20/1 ! queue ! videoconvert ! omxh264enc ! h264parse ! flvmux ! rtmpsink sync=false location=\"rtmp://127.0.0.1/live/livestream\"")
//pipeline, err := gst.ParseLaunch("nvarguscamerasrc sensor-id=0 name=mysource ! queue ! videoconvert ! omxh264enc ! h264parse ! flvmux ! rtmpsink sync=false location=rtmp://127.0.0.1/live/livestream")
if err != nil {
fmt.Println("ParseLaunch is err ", err)
return
}
pipeline.SetState(gst.StatePlaying)
time.Sleep(time.Second * 20)
pipeline.SetState(gst.StateNull)
pipeline = nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wulalade/hwpack.git
git@gitee.com:wulalade/hwpack.git
wulalade
hwpack
hwpack
d22efa2ac7c9

搜索帮助

344bd9b3 5694891 D2dac590 5694891