Could not initialize Xv output - linux

I have installed gstreamer-1.0 on my target board.
When I run the below command:
gst-launch-1.0 filesrc location="/home/test.mp4" ! decodebin ! videoconvert ! xvimagesink
I am getting the following output:
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
xvimagesink.c(1765): gst_xvimagesink_open (): /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0:
Could not open display (null)
Setting pipeline to NULL ...
Freeing pipeline ..
Please suggest some solution to make the pipeline work.
Regards,
Sainath

Hm do you have libxv somewhere?
Find
what happens when you check gst-inspect-1.0 xvimagesink ?
Also there is library path mentioned (| grep Filename).. you can ldd it:
ldd /usr/local/lib/gstreamer-1.0/libgstxvimagesink.so
I had some problems with this as well.. try to install libxv-dev or libxv1.. maybe dev is safer.

Related

Running gstreamer app in OpenVino using Windows subsystem in Linux (WSL2)

My system main OS is Windows-10 OS and installed WSL2 in subsystem.
Openvino is installed in Linux under WSL2. The reason is dlstreamer-gst is supported only in linux.
When I test the following test app, it works only for fps and display is not working.
If I run app as
./vehicle_pedestrian_tracking.sh person-bicycle-car-detection.mp4 10 CPU fps
I can see the output as
FpsCounter(1sec): total=346.54 fps, number-streams=1, per-stream=346.54 fps
FPSCounter(average): total=340.06 fps, number-streams=1, per-stream=340.06 fps
Got EOS from element "pipeline0".
Execution ended after 0:00:02.456260800
Setting pipeline to NULL ...
Freeing pipeline ...
When I run for display,
./vehicle_pedestrian_tracking.sh person-bicycle-car-detection.mp4 10 CPU dispaly
I have error as
ERROR: from element /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstXvImageSink:xvimagesink0: Could not initialise Xv output
Additional debug info:
../sys/xvimage/xvimagesink.c(1778): gst_xv_image_sink_open (): /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstXvImageSink:xvimagesink0:
Could not open display (null)
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
Is it display is not available in WSL subsystem?
Use MobaXTerm with WSL2 and change the command of xvimagesink to ximagesink in vehicle_pedestrian_tracking.sh.
My solution is I can't display but I can save to file as
gst-launch-1.0 filesrc location=video1.avi ! decodebin ! video/x-raw ! queue ! gvadetect model=/home/nyan/intel/dl_streamer/models/intel/vehicle-detection/FP16/model_fp16.xml model-proc=./model_proc/vehicle-detection.json inference-interval=10 threshold=0.6 device=CPU ! queue ! gvafpscounter ! filesink location=output.avi

qtdemux missing in gstreamer for an TSN test

I'm following a guide in https://tsn.readthedocs.io/avb.html#gstreamer-plugin to create a TSN talker, I've followed the guide BUT croscompiling inside a raspberry pi CM4, this has an ARM64 BCM2711.
Once I have all prepared and execute the last step:
sudo gst-launch-1.0 clockselect. \( clock-id=realtime filesrc location=sintel_trailer_720p_TOVERLAY.mp4 ! qtdemux ! h264parse config-interval=-1 ! avtpcvfpay processing-deadline=20000000 mtt=2000000 tu=125000 streamid=0xAABBCCDDEEFF000A ! avtpsink ifname=eth1.5 priority=3 processing-deadline=20000000 \)
I get the following error:
0:00:00.038947044 24548 0x153ca80 ERROR GST_PIPELINE
gst/parse/grammar.y:850:priv_gst_parse_yyparse: no element "qtdemux"
0:00:00.039168794 24548 0x153ca80 ERROR GST_PIPELINE
gst/parse/grammar.y:938:priv_gst_parse_yyparse: link has no sink
[source=#0x158c0f0] 0:00:00.045725632 24548 0x153ca80 ERROR
GST_PIPELINE gst/parse/grammar.y:938:priv_gst_parse_yyparse: link has
no source [sink=#0x1582900] WARNING: erroneous pipeline: no element
"qtdemux"
How can I include or replace the qtdemux plugin?
Where is supposed included this in the gstreamer repositories?
Thank in advance for your help.

GStreamer pipeline broken

I am not sure why this pipeline is breaking, I have gstreamer installed on linux from the websites exact instructions, any ideas?
gst-launch-1.0 v4l2src device=/dev/video0 ! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink -v
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000093207
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
If I change it to:
gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink -v
it will work but why will it not work the other way?
Your webcam transmits raw video output to whoever is listening to it. Adding videoconvert encodes the raw video to a codec that can be manipulated by the videoscale element and the end product of the manipulation to be understood by the autovideosink element.
So gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert! videoscale ! video/x-raw, width=2592, height=600 ! autovideosink is telling gstreamer to get the raw video from the camera, encode it into something that we understand, alter the video, and display it.
I really recommend that when you have doubts about an element, call gst-inspect-1.0 <element name> to see it's description and properties.

GStreamer Example from Official Tutorial does not Run on Ubuntu 18.04 with GStreamer 1.14.1

I installed a fresh version of Ubuntu 18.04 and I am trying to demux a single channel from a Matroska file by running the exact command from the Gstreamer documentation ( https://gstreamer.freedesktop.org/documentation/tutorials/basic/gstreamer-tools.html ).
Gstreamer is current:
gst-launch-1.0 --version
gst-launch-1.0 version 1.14.1
GStreamer 1.14.1
https://launchpad.net/distros/ubuntu/+source/gstreamer1.0
The problem is that Gstreamer keeps complaining that:
GstMatroskaDemux:d: Delayed linking failed
Error:
gst-launch-1.0 souphttpsrc location=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! matroskademux name=d d.video_00 ! matroskamux ! filesink location=sintel_video.mkv
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context, session=(SoupSession)NULL, force=(boolean)false;
WARNING: from element /GstPipeline:pipeline0/GstMatroskaDemux:d: Delayed linking failed.
Additional debug info:
./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstMatroskaDemux:d:
failed delayed linking pad video_00 of GstMatroskaDemux named d to some pad of GstMatroskaMux named matroskamux0
ERROR: from element /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0: Internal data stream error.
Additional debug info:
gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstSoupHTTPSrc:souphttpsrc0:
streaming stopped, reason not-linked (-1)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
How can I get this to work?
I actually remembered that webm is doing matroska file format. The example is actually faulty/out of date. The pad naming is wrong. Instead of 00 use 0:
gst-launch-1.0 souphttpsrc location=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm ! matroskademux name=d d.video_0 ! matroskamux ! filesink location=sintel_video.mkv

How to create an indexed video file with Gstreamer

I'm trying to use Gstreamer to create a seekable (indexed) video file in Linux. My pipelines work for recording and saving the data, but I can't figure out how to index the data so I can seek using gst_element_seek_simple() [http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+4%3A+Time+management]
I have seen this post: Gstreamer video output position tracking and seeking and validated I am sending an EOS on the pipeline with -e.
Here is my pipeline and output. I'm teeing it to display both to my embedded system's screen and save to the M4V file.
# gst-launch-0.10 -e v4l2src ! \
tee name=t !
queue !
video/x-raw-yuv,width=320,height=240 !
videoflip method=clockwise !
ffmpegcolorspace !
fbdevsink t. !
queue !
ffmpegcolorspace !
ffenc_mpeg4 !
filesink location=output.m4v
Here is the output:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not get parameters on device '/dev/video0'
Additional debug info:
v4l2src_calls.c(235): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Inappropriate ioctl for device
Setting pipeline to PLAYING ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
(gst-launch-0.10:534): GLib-CRITICAL **: Source ID 62 was not found when attempting to remove it
EOS on shutdown enabled -- Forcing EOS on the pipeline
Waiting for EOS...
Got EOS from element "pipeline0".
EOS received - stopping pipeline...
Execution ended after 10057977251 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
And here is the output of gst-discover on my new file:
beaglebone:# gst-discoverer-0.10 output.m4v
Analyzing file:///output.m4v
Done discovering file:///output.m4v
Topology:
video: MPEG-4 Video
Properties:
Duration: 0:00:00.000000000
Seekable: no
Thanks
You need to store the result in a seekable/indexed format. For that you can put the mpeg4 video inside a container such as mp4 or matroska. Use "! mp4mux ! filesink" or "! matroskamux ! filesink" to have it inside those formats that should make it seekable.
Side notes: gstreamer 0.10 is over 2 years obsolete and unmantained, please upgrade to 1.0.
http://gstreamer.freedesktop.org/ is the official gstreamer website and you will find the releases for 1.x versions there. The gstreamer.com website is a project is not related to the official project and, if you read the text in gstreamer.com, you will see that you should be using the official repository and installers.

Resources