Gstreamer on latest Raspbian


12 posts
by nitschkecm » Thu Jun 04, 2015 10:51 am
Hi,

I have been looking for a hardware accelerated jpg encoding for my Time-Lapse Project. I have come across this great tutorial in order to set this up http://www.onepitwopi.com/raspberry-pi/gstreamer-1-2-on-the-raspberry-pi/ However I did not get it to work yet.
I will give it another try on a completely new Raspbian Image.

Then I came across the fact that the latest release of Raspbian has already the gstreamer 1.2 included which is great news. I did the
Code: Select all
sudo apt-get dist-upgrade

however when I run the command from the tutorial
Code: Select all
gst-inspect-1.0 | grep omx

I get Command not found. Needless to say that the command that I really was looking forward to have functioning
Code: Select all
gst-launch-1.0 -e multifilesrc location="image_%04d.jpg" ! image/jpeg, framerate=12/1 ! \
decodebin ! video/x-raw, width=1296, height=976 ! progressreport name=progress ! \
omxh264enc target-bitrate=15000000 control-rate=variable ! video/x-h264, profile=high ! \
h264parse ! mp4mux ! filesink location=test.mp4


Does not work either. My question is now, how can I get this to work. An instruction for dummies would be the most welcome, any other help also appreciated!
Posts: 45
Joined: Wed Dec 17, 2014 11:01 am
by ktb » Thu Jun 04, 2015 11:03 am
Perhaps you need one of the gstreamer-tools packages, such as gstreamer1.0-tools or gstreamer0.10-tools. I'm not sure about the package names, I'm not using Raspbian right now.

Search for them to get the correct package names:
Code: Select all
sudo apt-get update
apt-cache search gstreamer
Posts: 1183
Joined: Fri Dec 26, 2014 7:53 pm
by nitschkecm » Thu Jun 04, 2015 11:09 am
Hi,

just added the gstreamer tools via
Code: Select all
sudo apt-get install gstreamer-tools


but it did not chance anything unfortunately regarding the commands.
Posts: 45
Joined: Wed Dec 17, 2014 11:01 am
by ktb » Thu Jun 04, 2015 11:15 am
nitschkecm wrote:Hi,

just added the gstreamer tools via
Code: Select all
sudo apt-get install gstreamer-tools


but it did not chance anything unfortunately regarding the commands.


You should search for the correct names of the actual packages. The gstreamer-tools command you used probably installs version 0.10. There will be two different packages for gstreamer version 0.10 and 1.0. It appears that you want version 1.0, so...
sudo apt-get install gstreamer1.0-tools
Posts: 1183
Joined: Fri Dec 26, 2014 7:53 pm
by nitschkecm » Thu Jun 04, 2015 12:15 pm
Thanks a lot. that made me progress a bit more. Now when I try to run

Code: Select all
gst-launch-1.0 -e multifilesrc location="image_%04d.jpg" ! image/jpeg, framerate=12/1 ! decodebin ! video/x-raw, width=1296, height=976 ! progressreport name=progress ! omxh264enc target-bitrate=15000000 control-rate=variable ! video/x-h264, profile=high ! h264parse ! mp4mux ! filesink location=test.mp4


I am getting the following error message. The directory and files are chmod 777
Code: Select all
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0: Could not initialize supporting library.
Additional debug info:
gstvideoencoder.c(1426): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
Failed to open encoder
Setting pipeline to NULL ...
Freeing pipeline ...


I have seen this quite often from other users as well but have no clue on where to search. Help is welcome!
Posts: 45
Joined: Wed Dec 17, 2014 11:01 am
by nitschkecm » Mon Jun 08, 2015 12:43 pm
I reinstalled Rapsbian (latest release) on a new Pi B+. All is updated to the latest version.
I have installed as well the gstreamer1.0-tools

when I run the above command to make the movie I am getting now a different error

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0:
streaming task paused, reason not-linked (-1)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


Anybody any suggestion on where to look or what to do ?
Posts: 45
Joined: Wed Dec 17, 2014 11:01 am
by jamesh » Mon Jun 08, 2015 3:24 pm
Start with a short pipeline, with bits taken out, dump the output to null. Then add stuff until it break, that should give you some idea of what's wrong. Also add the verbose flag to gst-launch (cannot remember exact syntax) to see if you can get more information out.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 16724
Joined: Sat Jul 30, 2011 7:41 pm
by nitschkecm » Wed Jun 10, 2015 2:02 pm
I ran the command like this
Code: Select all
gst-launch-1.0 -e multifilesrc location=image_%04d.jpg ! image/jpeg, framerate=12/1 ! decodebin ! video/x-raw, width=1296, height=976 ! progressreport name=progress ! omxh264enc target-bitrate=15000000 control-rate=variable ! video/x-h264, profile=high ! h264parse ! mp4mux ! filesink location=test.mp4  --gst-debug-level=4 > log3 2>&1


attached is the log file that was output. Thanks for further help !
Attachments
log3.log.zip
(10.82 KiB) Downloaded 106 times
Posts: 45
Joined: Wed Dec 17, 2014 11:01 am
by jbeale » Sun May 22, 2016 1:57 am
I'm trying to use gstreamer with omxh264enc as well. I am not familiar with the somewhat complex gstreamer pipelines; is there any example online of a command which works using omxh264enc (from any source, to any sink)?

Update: one example from this post https://www.raspberrypi.org/forums/view ... &start=225 doing a rtp stream appears to work with a USB camera on the RPi end, at least it doesn't generate an error- haven't yet successfully received it though.

Code: Select all
gst-launch-1.0 -v -e v4l2src device=/dev/video0 ! 'video/x-raw,format=I420,width=640,height=480,framerate=30/1' ! omxh264enc target-bitrate=6500000 control-rate=variable ! rtph264pay pt=96 ! udpsink host=192.168.10.2 port=5001
User avatar
Posts: 3209
Joined: Tue Nov 22, 2011 11:51 pm
by mariusco » Thu Dec 15, 2016 11:07 pm
The information in the post is incomplete.

WARNING: erroneous pipeline: no element "omxh264enc"
Posts: 11
Joined: Thu Nov 21, 2013 6:53 pm
by waqarrashid33 » Wed Jan 11, 2017 2:28 pm
Hi everyone,

I am trying to send stream (Motion JPEG) from one Pi1 to Pi2 and then I will process it together with picture from Pi2. Did anybody made the gstream work on Pi with picamera?
Posts: 1
Joined: Thu Jun 30, 2016 3:20 pm
by wpeForRPI » Fri Jan 27, 2017 6:31 am
nitschkecm wrote:I ran the command like this
Code: Select all
gst-launch-1.0 -e multifilesrc location=image_%04d.jpg ! image/jpeg, framerate=12/1 ! decodebin ! video/x-raw, width=1296, height=976 ! progressreport name=progress ! omxh264enc target-bitrate=15000000 control-rate=variable ! video/x-h264, profile=high ! h264parse ! mp4mux ! filesink location=test.mp4  --gst-debug-level=4 > log3 2>&1


attached is the log file that was output. Thanks for further help !

Hi,
try this
$gst-launch-1.0 playbin uri=file:///<path to mp4 media file>

that will at least skip your internal flow error.

Although I tried above and facing some segmentation fault issues.
Posts: 9
Joined: Mon Aug 22, 2016 11:00 am