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

7

10

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.

Olia answered 25/2, 2015 at 5:49 Comment(0)
L
14

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...

Leonardaleonardi answered 25/2, 2015 at 6:3 Comment(3)
remove your cache (rm .cache/gstreamer-1.0), then run gst-inspect-1.0 v4l2src...?Leonardaleonardi
it is difficult to debug this from a distance. what does gst-inspect-1.0 v4l2src tell you? I have ubuntu 14.04 as well and the package gstreamer1.0-plugins-good provides /usr/lib/x86_64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so which provides v4l2src pluginLeonardaleonardi
I edited my aswer to give you the exact command (I missed teh 1.0 in the package name...) hope this helps you outLeonardaleonardi
P
11

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.

Pyralid answered 24/8, 2020 at 20:45 Comment(1)
thanks for this comment! This could have been a few hours of head scratching.Nesbitt
S
3

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.

Succinic answered 26/2, 2015 at 8:40 Comment(0)
E
3

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 :)

Exchange answered 4/7, 2015 at 11:5 Comment(0)
K
1

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

Katherinkatherina answered 12/2, 2021 at 22:31 Comment(0)
L
0

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.

  1. Did rm -rf ~/.cache/gstreamer-1.0/ to clean the cache

  2. 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

  1. 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
Longrange answered 6/5, 2020 at 11:50 Comment(0)
B
-1

On Ubuntu you can install with just:

sudo apt-get install v4l-utils
Burrill answered 6/9, 2019 at 14:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.