Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple encode and decode pipeline with gstreamer?

Tags:

gstreamer

I'm trying to create a simple gstreamer1-0 pipeline that encodes and decodes h264 a webcam feed hopefully using the most basic elements possible. I already have (theoretically) all standard, good, bad and ugly gstreamer libraries installed. I used the word "Theoretically" because I don't have root privileges and I have to request IT to download/install every single library I might need and it's quite a pain.

I've tried the following pipeline but it didn't work:

gst-launch-1.0 v4l2src ! autovideoconvert ! x264enc bitrate=256 ! decodebin ! autovideosink 

I get the following output:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Missing element: H.264 decoder
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gstdecodebin2.c(3977): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
no suitable plugins found
Execution ended after 0:00:01.795803500
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

So according to that I'm missing a block to my plugin to decode h264 right?

Now I've read this forum and I've no idea how to install the decoder block. If somebody can explain to me how to do that in order to get that simple pipeline running?

like image 896
user3521388 Avatar asked Dec 14 '22 23:12

user3521388


2 Answers

You might be missing h264 decoder plugin. You can check it with

gst-inspect-1.0 | grep 264

The decoder that's generally used is avdec_h264

This will list the plugins related with h264. If you don't have any decoders you'll want to install gst-libav packages.

like image 57
Alper Kucukkomurler Avatar answered Dec 16 '22 13:12

Alper Kucukkomurler


In centos 7, you can install it via yum:

sudo yum install -y http://download1.rpmfusion.org/free/el/updates/7/x86_64/g/gstreamer1-libav-1.10.4-2.el7.x86_64.rpm

and then check it again:

gst-inspect-1.0 | grep 264

now you can see the decoders

like image 40
EJL Avatar answered Dec 16 '22 12:12

EJL