GStreamer fakesink can not get data - gstreamer

I run GStreamer exsample:qglwtextureshare. But I found it will crash at
qglrenderer.cpp Line168 Q_ASSERT (gst_is_gl_memory (mem)); I modified the pipeline like this :
m_pipeline =
GST_PIPELINE (gst_parse_launch
("videotestsrc ! "
"video/x-raw, width=640, height=480, "
"framerate=(fraction)30/1 ! "
"fakesink sync=1", NULL)); because gleffects effect=5 will pop error can not get fisheye shader.
And I don't change otherthings. I don't know why it can not get the frame data. Please help me, thanks.

Related

How can I save an GStreamer RTSP stream of unknown type to a file

I'm using this Gstreamer pipeline to send an RTSP stream of a camera.
./gst-rtsp-launch --port 8554 "( v4l2src device=/dev/video0 ! video/x-raw,framerate=30/1,width=640,height=480 ! rtpvrawpay name=pay0 pt=96 )"
I want to using playbin, so I don't need to specify the type of video from the rtsp stream. If I use this pipeline, I can get a single image from the camera:
gst-launch-1.0 playbin uri=rtsp://(ip-of-camera):8554 video-sink="jpegenc ! filesink location=capture1.jpeg"
But if I try this pipeline, to save as a file:
gst-launch-1.0 playbin uri=rtsp://(ip-of-camera):8554 video-sink="videoconvert ! video/x-h264,width=320,height=240 ! mp4mux ! filesink location=test.mp4"
I get this error:
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source/GstUDPSrc:udpsrc1: Internal data stream error.
Additional information for debugging:
../libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstRTSPSrc:source/GstUDPSrc:udpsrc1:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.094968753
Defining the processing queue to NULL...
Freeing the processing queue...
Note: I had translate the last two lines.
Is there a problem in the pipeline I'm using to save the stream as a file?
I copied your pipeline and in worked.
I only added -e after gst-launch-1.0, so that GStreamer writes all necessary information to the file when ctrl-C is pressed:
gst-launch-1.0 -e playbin uri=(rtsp url) video-sink="videoconvert ! video/x-h264,width=320,height=240 ! mp4mux ! filesink location=test.mp4"
Maybe you are using an older version of GStreamer?
I am using GStreamer 1.20.0

C GStreamer empty pipeline

I am building my pipeline like this:
gst-launch-1.0 -v filesrc location=" + video_filename + " ! qtdemux ! queue max-size-buffers=0 max-size-time=0 ! vpudec frame-drop=0 ! queue ! imxv4l2sink device=/dev/video16
This is how I stop video playback
gst_element_set_state (m_gst_pipeline, GST_STATE_NULL);
g_main_loop_quit (m_mainloop);
gst_object_unref(m_gst_pipeline);
The stopping itsself works fine, only issue is that I get the last video frame displayed even when exiting the program. How do I flush the pipeline before destruction so I have a black screen?

GStreamer opusdec: Try decode Opus bitstream failed

Initial Issue
I would like to use gstreamer plugin opusdec to decode an Opus bitstream. The final purpose is to make glue around it with appsrc and appsink as input/output, to decode 20 ms Opus packets coming from a RTP packet payload and provide PCM sample.
Remark: I can't use gstreamer rtpopusdepay
The following pipeline works:
gst-launch-1.0 filesrc location=testvector01.bit.opus ! oggdemux !
opusdec ! fakesink
In my final application I'm no expected OGG contained data so I did the following:
1) Desencapsulate Opus bitstream
gst-launch-1.0 filesrc location=testvector01.bit.opus ! oggdemux !
filesink location = testvector01.bit.demux
That works. And then:
2) Decode Opus bitstream
gst-launch-1.0 filesrc location=testvector01.bit.demux ! opusdec !
fakesink
and I have the following error:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ..
Input File
testvector01.bit.opus
From Opus test vector :https://people.xiph.org/~greg/opus_testvectors/
My question is:
What is the proper way to use gstreamer plugin opusec without transport container?
Update
Gstreamer version 1.2.4
As recommended I tried to add opusparse after filesrc and got the following error.
Pipeline is PREROLLING ...
(gst-launch-1.0:5147): GStreamer-WARNING **:
gstpad.c:4555:store_sticky_event:<opusparse0:src> Sticky event
misordering, got 'caps' before 'stream-start'
(gst-launch-1.0:5147): GStreamer-WARNING **:
gstpad.c:4555:store_sticky_event:<opusdec0:sink> Sticky event
misordering, got 'caps' before 'stream-start' Pipeline is PREROLLED
... Setting pipeline to PLAYING ... New clock: GstAudioSinkClock
ERROR: from element /GstPipeline:pipeline0/GstOpusDec:opusdec0:
Decoding error: -4 Additional debug info: gstopusdec.c(460):
opus_dec_chain_parse_data ():
/GstPipeline:pipeline0/GstOpusDec:opusdec0 Execution ended after
0:00:00.063372478 Setting pipeline to PAUSED ... Setting pipeline to
READY ... Setting pipeline to NULL ... Freeing pipeline ...
GStreamer 1.8.1
The following pipeline
gst-launch-1.0 filesrc location = testvector01.bit.demux ! opusparse !
opusdec ! audioconvert ! alsasink
halt here:
Setting pipeline to PAUSED ... Pipeline is PREROLLING ...
Gstreamer 1.13.1
gst-launch-1.0 filesrc location = testvector01.bit.demux ! opusparse !
opusdec ! alsasink
Playback just produce a short audio glitch while no gstreamer error is raised.
gst-launch-1.0 filesrc location = testvector01.bit.opus ! oggdemux ! opusparse !
opusdec ! alsasink
Playback is choppy while no gstreamer error is raised.
Regards,
appsrc is-live=true do-timestamp=true name=audiosrc ! opusparse ! oggmux ! filesink location=test.ogg
gstreamer 1.14.1 works fine
You need to have a parser (opusparse) in between as opusdec doesn’t know what format it is, try the following pipeline:
gst-launch-1.0 filesrc location=testvector01.bit.demux ! opusparse !
opusdec ! fakesink dump=true

No key frames when sending H263 with gstreamer

I'm trying to stream H263 via RTP with gstreamer 1.0. It works just fine aside from no key frames being sent. The command line looks like this:
gst-launch-1.0 videotestsrc pattern=ball ! avenc_h263 ! rtph263pay pt=34 ! udpsink host=10.0.75.196 port=25782 sync=true
The result is that it starts from black and only works with changes thereafter. Could it have anything to do with avenc_h263 using stuff that only H263+ or H263++ handles?
I would be very grateful for any help on this!
I finally found the problem! Standard rtp-payload-size is 0. Changing this parameter to anything above zero, I tried 1 and 20, makes it run smooth and with full frames.
gst-launch-1.0 videotestsrc pattern=ball ! avenc_h263 rtp-payload-size=10 ! rtph263pay pt=34 ! udpsink host=10.0.75.196 port=25782 sync=true

GStreamer: Play mpeg2

I'm trying to play a local mpeg2 TS file with gstreamer with this:
gst-launch filesrc location=open_season.mpg ! mpeg2dec ! xvimagesink
The first frame appears as big blocks of color and then stops. Any thoughts about what I'm doing wrong here? Does a -TS file need to be handled differently than this?
Here's the log:
$ gst-launch filesrc location=open_season.mpg ! mpeg2dec ! xvimagesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ....
WARNING: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Internal data flow problem..
Additional debug info:.
gstbasesink.c(3492): gst_base_sink_chain_unlocked (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Received buffer without a new-segment. Assuming timestamps start from 0.
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 6866757291 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ..
I think first you should first try to play the file with the help of playbin2. If you are able to play it then u should use decodebin2 ,debug its output and construct your pipeline accordingly.
The syntax for playbin2 is as follows :-
gst-launch playbin2 uri = file:///home/user1031040/Desktop/file.mpg
The syntax for decodebin2 is as follows:-
gst-launch filesrc location = file.mpg ! decodebin2 ! autovideosink