demos for https://github.com/notedit/gst
notedit / gst-go-demo Goto Github PK
View Code? Open in Web Editor NEWdemos for https://github.com/notedit/gst
demos for https://github.com/notedit/gst
demos for https://github.com/notedit/gst
I compiled a modified version of the demo appsrc on windows with 'go build' that generated the appsrc.exe.
Running the apprsrc.exe actually results in an immediate crash of the application.
And then I tried integrating directly into my own program, the similar problem exists. What could potentially be the problem here?
Recently gstreamer is upgraded to 1.20.0 by brew of mac x86 notebook.
After upgrade, the examples do not work as follows.
In gstreamer 1.18.5, they work well.
[ GSTREAMER ] shim init
[ GST ] program is linked against GStreamer 1.20.0
panic: pipeline error
goroutine 1 [running]:
main.main()
/Users/stoney/coding/go/src/github.com/notedit/gst-go-demo/appsrc/main.go:15 +0x198
exit status 2
Code snippet:
//Want to transcode Incomming RTP packet in mulaw codec (PCMU)
//What I am trying to achieve is push on appsrc and pull it on appsink
package main
import (
"fmt"
"time"
"reflect"
"github.com/notedit/gst"
)
func main() {
pipeline, err := gst.ParseLaunch("appsrc name=mysource ! queue ! appsink name=mysink")
if err != nil {
panic("pipeline error")
}
element := pipeline.GetByName("mysource")
sink := pipeline.GetByName("mysink")
pipeline.SetState(gst.StatePlaying)
fmt.Println(reflect.TypeOf(sink))
go func(element *gst.Element) {
i:=0
for {
if i > 100 {
break
}
data := make([]byte, 320*240*3)
err := element.PushBuffer(data)
if err != nil {
fmt.Println("push buffer error")
break
}
fmt.Println("push one")
i++
time.Sleep(50000000)
}
}(element)
for {
sample, err := sink.PullSample()
if err != nil {
if element.IsEOS() == true {
fmt.Println("eos")
break
} else {
fmt.Println(err)
continue
}
}
fmt.Println("got sample", sample.Duration)
}
pipeline.SetState(gst.StateNull)
pipeline = nil
element = nil
//videoCap = nil
}
Error:
It thowing error as:
** (main:9358): CRITICAL **: 02:47:33.320: gst_app_sink_is_eos: assertion 'GST_IS_APP_SINK (appsink)' failed
could not pull a sample from appsink
-> sink receives 'eos' as it starts
suggest or help pls????
Thanks in advance...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.