Missing Plugin when using gst-discoverer - gstreamer

Getting error when using gst-discoverer script.
Is there any way to get the name?
When set the VERBOSE mode on (GST_DEBUG=3) , got the following msgs:
basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
WARN basesrc gstbasesrc.c:3583:gst_base_src_start_complete:<source> pad not activated yet
0:00:00.106675435 140 0x75e01d50 WARN qtdemux qtdemux_types.c:233:qtdemux_type_get: unknown QuickTime node type pasp
0:00:00.106839132 140 0x75e01d50 WARN qtdemux qtdemux.c:3031:qtdemux_parse_trex:<qtdemux0> failed to find fragment defaults for stream 1
.....
uridecodebin gsturidecodebin.c:921:unknown_type_cb:<discoverer-uri> warning: No decoder available for type 'video/x-h264, stream-format=(string)avc,
....
uridecodebin gsturidecodebin.c:988:no_more_pads_full:<discoverer-uri> error: no suitable plugins found:
...
Tried installing libav as well
apt-get install gstreamer1.0-libav --no-install-recommends still no progress.
Not sure if I am missing anything. Can you guys please help me in solving the issue.
Thanks for your help.

Related

Missing gstreamer plugin

I've never used gstreamer before but I'm trying to use it and video4linuxloopback to turn my IPad into a jury-rigged webcam. I have an app that outputs the video from the camera to an IP on the local network but no matter what I did I kept getting an EOS from "pipeline0". When trying to run it with decodebin to see if it could auto-detect what it needed, it says that it needs a plugin for text/html but I can't seem to find it, assuming it exists. Here's the full log
$ gst-launch-1.0 souphttpsrc location=http://192.168.1.6/ ! decodebin ! videoconvert ! v4l2sink device=/dev/video0
libv4l2: error getting pixformat: Invalid argument
Setting pipeline to PAUSED ...
libv4l2: error getting pixformat: Invalid argument
Pipeline is PREROLLING ...
Got context from element 'souphttpsrc0': gst.soup.session=context, session=(SoupSession)NULL, force=(boolean)false;
Missing element: text/html decoder
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
../gst-plugins-base/gst/playback/gstdecodebin2.c(4678): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
no suitable plugins found:
Missing decoder: text/html (text/html)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

Why gstreamer with vaapih264enc shows "context pad peer query failed"?

I would like to use hardware encoding to compress a raw video file using gstreamer and vaapi. I am getting Could not initialize supporting library, which does not allow encoder to open. Possibly context pad peer query failed is the root cause for this. But I am not sure. I use the following pipeline:
gst-launch-1.0 -v filesrc location=input.raw ! videoparse width=1280 height=1024 format=yuy2 framerate=20/1 ! vaapih264enc ! h264parse ! qtmux ! filesink location=compressed.mov
Pipeline fails with message:
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0: Could not initialize supporting library.
Additional debug info:
gstvideoencoder.c(1534): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstVaapiEncodeH264:vaapiencodeh264-0:
Failed to open encoder
Setting pipeline to NULL ...
Freeing pipeline ...
What am I doing wrong?
Using GST_DEBUG=3 gst-launch-1.0 --gst-debug-level=4 to start the pipeline gives me this:
INFO GST_STATES gstbin.c:2316:gst_bin_element_set_state:<vaapiencodeh264-0> current NULL pending VOID_PENDING, desired next READY
INFO GST_CONTEXT gstvaapivideocontext.c:106:context_pad_query:<vaapiencodeh264-0:src> context pad peer query failed
INFO GST_CONTEXT gstvaapivideocontext.c:106:context_pad_query:<vaapiencodeh264-0:sink> context pad peer query failed
INFO GST_CONTEXT gstvaapivideocontext.c:180:_gst_context_query:<vaapiencodeh264-0> posting `need-context' message
INFO vaapi gstvaapidisplay.c:119:libgstvaapi_init_once: gstreamer-vaapi version
WARN videoencoder gstvideoencoder.c:1534:gst_video_encoder_change_state:<vaapiencodeh264-0> error: Failed to open encoder
INFO GST_ERROR_SYSTEM gstelement.c:1879:gst_element_message_full:<vaapiencodeh264-0> posting message: Could not initialize supporting library.
INFO GST_ERROR_SYSTEM gstelement.c:1902:gst_element_message_full:<vaapiencodeh264-0> posted error message: Could not initialize supporting library.
INFO GST_STATES gstelement.c:2657:gst_element_change_state:<vaapiencodeh264-0> have FAILURE change_state return
INFO GST_STATES gstelement.c:2247:gst_element_abort_state:<vaapiencodeh264-0> aborting state from NULL to READY
INFO GST_STATES gstbin.c:2780:gst_bin_change_state_func:<pipeline0> child 'vaapiencodeh264-0' failed to go to state 2(READY)
My hardware should support this and driver seems to be installed properly:
shell:~$ vainfo
libva info: VA-API version 0.39.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Skylake - 1.7.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
vaapi plugin seems to be properly installed as well:
gst-inspect-1.0 vaapih264enc
Factory Details:
Rank primary (256)
Long-name VA-API H.264 encoder
Klass Codec/Encoder/Video
Description A VA-API based H.264 video encoder
Author Wind Yuan <feng.yuan#intel.com>
Plugin Details:
Name vaapi
Description VA-API based elements
Filename /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvaapi.so
Version 1.8.3
License LGPL
Source module gstreamer-vaapi
Source release date 2016-06-09
Binary package gstreamer-vaapi
Origin URL http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer
...
Thank you for any suggestions.
I believe incorrect user configuration/permissions were the reason why the encoder library could not be initialized. It would be nice if knew how to find some log messages somewhere on my system to point me in that direction (it was a lucky stumble on my part).
I got hardware encoding working after changing two things: 1) the user under which I was running these command did not have the right permissions or configuration. I did not investigate what exactly yet. 2) Once I used proper user account I got an error message that suggested I use vaapipostproc before vaapih264enc to resolve chroma type that was not understood by the en.
The final pipeline command I used is: sudo -u proper_user gst-launch-1.0 filesrc location=input.raw ! videoparse width=1280 height=1024 format=yuy2 framerate=20/1 ! videoconvert ! vaapipostproc ! vaapih264enc ! qtmux ! filesink location=hardware.compressed.mov

gscam can't find plugin but gstreamer works fine

I'm trying to use gscam (http://wiki.ros.org/gscam) compiled with the gstreamer 1.0 flag with a camera connected via ethernet to my laptop running Ubuntu16.04, ROS kinetic and gstreamer 1.0.
I'm able to properly start gstreamer and see the stram window using the command:
gst-launch-1.0 udpsrc caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=H264, payload=96" port=5002 ! rtph264depay ! video/x-h264,framerate=24/1,width=640,height=480 ! queue ! avdec_h264 ! videoconvert ! autovideosink sync=FALSE
but following the gscam instuction, running the command:
export GSCAM_CONFIG="udpsrc caps="application/x-rtp,media=video,clock-rate=90000,encoding-name=H264,payload=96" port=5002 ! rtph264depay ! video/x-h264,framerate=24/1,width=640,height=480 ! decodebin ! videoconvert"
and then:
rosrun gscam gscam
I get the error:
[FATAL] [1533651268.132080791]: no element "udpsrc"
[FATAL] [1533651268.132104353]: Failed to initialize gscam stream!
This happens both when installing gscam using:
sudo apt-get install ros-kinetic-gscam
and compiling it from source using catkin
Can anyone please help me?
Update:
A crucial missing information is that gscam was build from source with gstreamer-1.0 flags.
Thus, it is not the common application from the ROS ppa which uses gstreamer-0.10.
First the direct solution: It seems that you are missing some plugin packages.
udpsrc is part of gst-plugins-good-plugins-0.10, which you can install under Ubuntu 16.04 as follows (with necessary base plugins):
sudo apt-get install gstreamer0.10-plugins-base gstreamer0.10-plugins-base-apps gstreamer0.10-plugins-good
Second, some info about gstreamer: gscam does depend on gstreamer-0.10 and not gstreamer-1.0, which are completely disjunct versions.
You can check this out by typing
$ apt-cache depends ros-kinetic-gscam
...
libgstreamer0.10-0
...
You have to watch out when elaborating config strings with gstreamer-1.0 and then try to use these in gstreamer-0.10.
It might not always work, so try directly working with gstreamer-0.10.

gstreamer 1.0 uninstalled link to & use external x264enc

I have installed latest gstreamer uninstalled via git and have it in,
/home/ec2-user/gst/master/
to launch GST I use, cd /home/ec2-user/gst; ./gst-master; myGstProg. When I test for x264enc I get not found.
[ec2-user#xxxxxx master]$ gst-inspect-1.0 x264enc
No such element or plugin 'x264enc'
As part of our normal dev build we have compiled and installed both gst and x264enc,
[ec2-user#xxxxxx ~]$ gst-inspect-1.0 x264enc
Factory Details:
Rank primary (256)
Long-name x264enc
Klass Codec/Encoder/Video
Description H264 Encoder
Author Josef Zlomek <josef.zlomek#itonis.tv>, Mark Nauwelaerts <mnauw#users.sf.net>
Plugin Details:
Name x264
Description libx264-based H264 plugins
Filename /home/myBin/lib/gstreamer-1.0/libgstx264.so
Compiling the source, no problems are reported, however when running the program at gst_element_factory_make ("x264enc", "myX264"); we get,
GStreamer-CRITICAL **: gst_bin_add: assertion 'GST_IS_ELEMENT (element)' failed
At first I copied /home/myBin/lib/gstreamer-1.0/libgstx264.so to /home/ec2-user/gst/test_libs/libgstx264.so and addedLD_LIBRARY_PATH=/home/ec2-user/gst/test_libs:$LD_LIBRARY_PATH to master/gstreamer/scripts/gst-uninstalled
How/what do I update under the /home/ec2-user/gst to include the x264enc element?
As I can't make comments, some remarks:
In my point of view the problem is that when trying to compile the GST_Head some library is missing and refuses to compile x264 plugin.
This plugin (x264->x264enc) is located at gst-plugins-ugly library.
In my computer, for example (gstreamer unninstaled 1.10.1 version), if I launch ./autogen.sh or ./configure, referring to the x264 plugin, it prints me the next stuff:
configure: *** checking feature: x264 plug-in ***
configure: *** for plug-ins: x264 ***
checking for X264... yes
configure: *** These plugins will be built: x264
checking that generated files are newer than configure... done
It is printing the same to you?
You should also check that x264 and libx264-* libraries are correctly installed on your system, otherwise the configure will not compile x264 plugin.
Hope this helps.

Gstreamer Error: pipeline could not be constructed: no element "v4l2src"

Am using Ubuntu(14.04) and I am getting this error while trying to use gstreamer.
gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480 ! x264enc ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5000
I have checked the gst-inspect-1.0 v4l2src
It say element not found "No such element or plugin 'v4l2src'"
What should I do ? From where can I get this element or plugin. I have tried resinstalling entire gstreamer. But am unable to do so.
the v4l2src plugin belongs to the gstreamer-plugins-good package; so
sudo apt-get install gstreamer1.0-plugins-good
should help you out
Gstreamer packages most of its plugins in separate packages; you have
gst-plugins-base
gst-plugins-good
gst-plugins-ugly
and more. They are pluggable; so just updating gstreamer won't auto-select gst-plugins-good for you...
I had this same issue a while back, and what caused it for me was the fact that Anaconda was installed and had its base environment active. The solution was to run the command:
conda deactivate
And then try again.
Note: In my particular case it was harder to spot because I also had Oh-My-Bash installed and it removed Anaconda's environment indicator in the terminal.
Does
gst-inspect-1.0 -b
list any blacklisted plugins? If not check the the pluging pysically exists:
locate libgstvideo4linux2.so
There should be one under e.g.
/usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
or
/usr/lib/gstreamer-1.0/libgstvideo4linux2.so
Then remove the registry cache again and run
GST_DEBUG="*:5" gst-inspect-1.0 2>debug.log
Search the log for v4l2 and check if gstreamer reports a reason why it won't load the plugin.
I'm using a gstreamer-1.0 on Raspberry and I was having the same issue. As I was running out of options I've tried to install also the 0.10 plugins and unexpectedly it works.
sudo apt-get install gstreamer0.10-plugins-good
my 2 cent ^_^
EDIT:
Well, actually it doen't work yet, but at least it's giving me a different error :)
EDIT 2:
It was a syntax error, It actually works for me :)
For my case the short answer is:
Run export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
Long answer:
Following the steps from #ensonic, I saw that most of my libraries were blacklisted.
Did rm -rf ~/.cache/gstreamer-1.0/ to clean the cache
Did gst-launch-1.0 v4l2src and got many errors like this:
(gst-plugin-scanner:5082): GStreamer-WARNING **: 19:41:22.907: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstttmlsubs.so': librga.so: cannot open shared object file: No such file or directory
Which showed that I didn't have the librga.so file
I could find librga.so on my system by running locate librga.so, but it seems that it was not on my dynamic shared libraries path. To do that I only had to run export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib:/usr/lib:/usr/local/lib
My error was due to Anaconda virtual environment and other missing plug-in. I solved by [this][1]:
conda deactivate
sudo apt-get install gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly libxml2 libpcap0.8 libaudit1 libnotify4
On Ubuntu you can install with just:
sudo apt-get install v4l-utils