gkreidl
Posts: 5710
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Gstreamer 1.0 for raspbian

Thu Oct 30, 2014 7:31 am

Ivan Tham wrote:Can I use Gstreamer1.0 in midori or other browser?
It's used by the new webkit3 engine to display videos inside the browser (epiphany, kweb3).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

codestar02
Posts: 5
Joined: Fri Oct 31, 2014 6:27 am

Re: Gstreamer 1.0 for raspbian

Fri Oct 31, 2014 6:50 am

Hello,

I am pretty new to using the camera module and gstreamer so please bare with me.

My goal:
To get one model b+ streaming video with gstreamer onto it's own display AND have a SECOND model b+ viewing the stream on a second stream

What I have accomplished:
1) Fresh install of raspbian on both pi's, successful install of gstreamer on both ends
2) both pi's set with static ip's and able to communicate. hooked up to a switch and not a router
3) camera is functioning with raspivid by itself

My problem:
After using this line on the pi WITH the camera

Code: Select all

raspivid -n -w 1280 -h 720 -b 4500000 -fps 30 -vf -hf -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse ! rtph264pay config-interval=10 pt=96 ! udpsink host=10.3.99.33 port=9000
It spits out a bunch of code, and ends with

Code: Select all

Pipeline is PREROLLED..
Setting pipeline to PLAYING...
New clock: GstSystemClock
And then sits there and nothing else happens. The led on the cam is on, and the ethernet light is blinking. No video is shown on the screen.

I use the following code on the receiver pi:

Code: Select all

gst-launch-1.0 -v udpsrc port=9000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! avdec_h264 ! videoconvert ! autovideosink sync=false
This will generate a few more lines of code on the second pi, where i can see 'Setting pipeline to PLAYING...', but once again it will stop after displaying

Code: Select all

New clock: GstSystemClock
Once again I reiterate that I'm quite new at this streaming game, but I have been messing around for 10's of hours trying to figure this out.

Once again, my endgame is to have one pi (connected to the camera) displaying a constant feed on the screen, and also pipelining a stream to a SECOND pi to also view the same stream.

If anyone would be kind enough to point me in the right direction or point out one of my probable beginners errors, it would make my week!

Thank you very much!

sphaero
Posts: 29
Joined: Sun Oct 26, 2014 9:40 am
Location: Planet Earth
Contact: Website

Re: Gstreamer 1.0 for raspbian

Fri Oct 31, 2014 9:26 am

Try first with a test source

something like:

Code: Select all

gst-launch-1.0 videotestsrc ! \
 jpegenc ! \
 rtpjpegpay ! \
 udpsink host=127.0.0.1 port=5200
And on the receiver:

Code: Select all

gst-launch-1.0 udpsrc port=5200 ! \
 rtpjpegdepay ! \
 jpegdec ! \
 autovideosink
See if that does anything. If you are new gstreamer or streaming in general read this:
http://www.z25.org/static/_rd_/videostr ... index.html
--
http://twitter.com/sphaero
http://twitter.com/z25org

codestar02
Posts: 5
Joined: Fri Oct 31, 2014 6:27 am

Re: Gstreamer 1.0 for raspbian

Fri Oct 31, 2014 10:06 pm

It seems to be doing the same thing...

On camera side:

Code: Select all

Setting pipeline to PAUSED...
Pipeline is PREROLLING...
Pipeline is PREROLLED...
Setting pipeline to PLAYING...
New clock: GstSystemClock
No LED on the cam

On receiver side:

Code: Select all

Setting pipeline to PAUSED...
Pipeline is live and does not need PREROLL...
Setting pipeline to PLAYING...
New clock: GstSystemClock
I may be misunderstanding how gstreamer is supposed to work, is the feed supposed to show up on the screen as soon as I enter the command? I am getting no picture on either either Pi

Thanks

sphaero
Posts: 29
Joined: Sun Oct 26, 2014 9:40 am
Location: Planet Earth
Contact: Website

Re: Gstreamer 1.0 for raspbian

Fri Oct 31, 2014 11:16 pm

Try the following:

Code: Select all

gst-launch-1.0 -v  videotestsrc ! autovideosink
This should give you a test video.
If it doesn't try:

Code: Select all

GST_DEBUG=4 gst-launch-1.0 -v  videotestsrc ! autovideosink
You'll see more debug output.
If you're running Xorg I think it should work with this:

Code: Select all

gst-launch-1.0 -v  videotestsrc ! ximagesink
If you run from command line you need the glimagesink or eglessink (or something called like that)
Run gst-inpect-1.0 to find out which modules... Again read the doc I send you to know what that's all about.
You also need to know what version of gstreamer you are running:

Code: Select all

dpkg -l | grep gstreamer
--
http://twitter.com/sphaero
http://twitter.com/z25org

codestar02
Posts: 5
Joined: Fri Oct 31, 2014 6:27 am

Re: Gstreamer 1.0 for raspbian

Fri Oct 31, 2014 11:47 pm

Test video works on each pi, and i am able to ping each one so i know that they are able to communicate. After reading through and trying the Gstreamer document examples, I cannot seem to get any of the sent pipelines from one pi to show jpegs or video on the second pi :| :|

Thank you for bearing with me and my novice level problems

diederik
Posts: 389
Joined: Wed Mar 26, 2014 11:17 pm

Re: Gstreamer 1.0 for raspbian

Sat Nov 01, 2014 4:52 am

sphaero wrote:If you are new gstreamer or streaming in general read this:
http://www.z25.org/static/_rd_/videostr ... index.html
Thank you, much appreciated 8-)

codestar02
Posts: 5
Joined: Fri Oct 31, 2014 6:27 am

Re: Gstreamer 1.0 for raspbian

Mon Nov 03, 2014 7:54 am

FINALLY got it streaming!

However, the video is extremely choppy, laggy, and fragmented. Is there a way to speed this up? Right now i'm seeing around 4 seconds of delay, and quick movements turn the screen to a mass of blocks.

My goal is an infinite stream onto a second, overclocked b+ pi, that does nothing else but view the video.

Sending line:

Code: Select all

raspivid -f -b 10000000 -fps 30 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse! rtph264pay config-interval=1 pt=96 ! udpsink host=10.3.99.255 port=9000
Receiving line:

Code: Select all

gst-launch-1.0 -v udpsrc port=9000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
Thanks

loadbang
Posts: 33
Joined: Mon Aug 13, 2012 4:56 pm

Re: Gstreamer 1.0 for raspbian

Mon Dec 01, 2014 10:54 pm

fruitoftheloom wrote:
sphaero wrote:Thanks for the pointer. I missed some sources indeed.
Just tested and it is much smoother :) although gstreamer takes quite some overhead. 50% cpu compared to 3-7%. Anybody got lower cpu burden?
Did you fully remove the packages installed by the byvontaene.de-repository prior to dist-upgrade ?
How would one do this?

sphaero
Posts: 29
Joined: Sun Oct 26, 2014 9:40 am
Location: Planet Earth
Contact: Website

Re: Gstreamer 1.0 for raspbian

Tue Dec 02, 2014 9:11 am

sudo apt-get remove --purge gstreamer1.0*
sudo apt-get update && sudo apt-get dist-upgrade
--
http://twitter.com/sphaero
http://twitter.com/z25org

paul_espinosa
Posts: 7
Joined: Thu Dec 11, 2014 8:18 pm

Re: Gstreamer 1.0 for raspbian

Thu Dec 25, 2014 9:23 pm

hello i installa a precompilated version on my raspberry pi b+ with rasbian ...i also installed qt 4 ...but now a need use gsstreamer on qt ...

my file.pro
INCLUDE PATH += /usr/lib/arm-linux-gnueabiht/gstreamer-1.0
LIBS += -L/ /usr/lib/arm-linux-gnueabiht/gstreamer-1.0
LIBS += -lglib-2.0 -lpthread -lgstreamer-1.0 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt
and in the main.cpp
#include <gst/gst.h>
but show this error gst/gst.h no such file or directory
how i can writhe or use correctly this libs ????
i need play mp3 in my raspberry in an aplicacion

User avatar
Defiant
Posts: 177
Joined: Tue Oct 30, 2012 6:17 pm
Location: Hamburg, Germany

Re: Gstreamer 1.0 for raspbian

Thu Dec 25, 2014 9:26 pm

Install the -dev packages

nitschkecm
Posts: 50
Joined: Wed Dec 17, 2014 11:01 am

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 9:44 am

I have followed the instructions and wanted to use the Gstreamer in order to encode video from jpg files I have (TimeLapse). However when I 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 this return

Code: Select all

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstMultiFileSrc:multifilesrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2867): 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 ...
I have no clue where to search. Any help is more than welcome

User avatar
Defiant
Posts: 177
Joined: Tue Oct 30, 2012 6:17 pm
Location: Hamburg, Germany

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 11:10 am

Above packages are outdated, please use the ones in raspbian instead.

nitschkecm
Posts: 50
Joined: Wed Dec 17, 2014 11:01 am

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 11:13 am

Ok I will give it a try on a fresh raspbian install. Thanks for the update.
Should I just use the

Code: Select all

sudo apt-get install gstreamer1.0
or is there anything else needed especially if I want to use the gstreamer to create the video of time-lapse jpg

fruitoftheloom
Posts: 17434
Joined: Tue Mar 25, 2014 12:40 pm

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 12:22 pm

nitschkecm wrote:Ok I will give it a try on a fresh raspbian install. Thanks for the update.
Should I just use the

Code: Select all

sudo apt-get install gstreamer1.0
or is there anything else needed especially if I want to use the gstreamer to create the video of time-lapse jpg
Raspbian latest should include the latest gstreamer, that is why you should be wary of old posts ;)

Code: Select all

sudo apt-get update
sudo apt-get dist-upgrade
Adieu

nitschkecm
Posts: 50
Joined: Wed Dec 17, 2014 11:01 am

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 3:47 pm

Hi

just tried that but I cannot run commands like

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
to create a time-lapse video. Therefore I assume that I cannot use the standard version which is supplied now with Raspbian. do you have any good suggestion on how to make use of gstreamer and hw acceleration in order to encode time-lapse videos ?

User avatar
Defiant
Posts: 177
Joined: Tue Oct 30, 2012 6:17 pm
Location: Hamburg, Germany

Re: Gstreamer 1.0 for raspbian

Wed Jun 03, 2015 5:13 pm

You should ask this in a separate, not dead thread.

tkbd
Posts: 5
Joined: Sat Nov 07, 2015 2:09 am

Re: Gstreamer 1.0 for raspbian

Mon Feb 22, 2016 7:49 pm

mp4 over udp/rtp

Building gstreamer pipelines really feels like making blind guesses so far. Is there some essential documentation that i missed?
I've spent hours and hours trying to stream a 720p mp4 file from a master Raspberry PI 2 to two slave Raspberry's (synchronously).

My best semi-working pipelines:

Code: Select all

// server
gst-launch-1.0 -v filesrc location=video.mp4 ! qtdemux ! video/x-h264 ! rtph264pay ! udpsink host=192.168.0.255 port=5000
-or
gst-launch-1.0 -v filesrc location=video.mp4 ! qtdemux ! queue ! rtph264pay ! udpsink host=192.168.0.255 port=5000

// client
gst-launch-1.0 -v udpsrc port=5000 caps = 'application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, sprop-parameter-sets=(string)"Z2QAH6zZQFAFuhAAAAMAEAAAAwPA8YMZYA\=\=\,aOvssiw\=", payload=(int)96, ssrc=(uint)36838312, timestamp-offset=(uint)1359991347, seqnum-offset=(uint)58019' ! rtpjitterbuffer latency=1000 ! rtph264depay ! decodebin ! videoconvert ! eglglessink
-or
gst-launch-1.0 -v udpsrc port=5000 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264" ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! eglglessink sync=false
The client connect almost instantly to the rtp stream which is great. (compared to vlc, 5-10sec)
But the video stutters and glitches occasionally.
I'm also not sure which is the problem, the server or client.

User avatar
Defiant
Posts: 177
Joined: Tue Oct 30, 2012 6:17 pm
Location: Hamburg, Germany

Re: Gstreamer 1.0 for raspbian

Mon Feb 22, 2016 7:57 pm

Defiant wrote:You should ask this in a separate, not dead thread.
this, and tkbd if you create a new thread please add more details, e.g. the medium you are using (wifi/ethernet)

sageradh
Posts: 1
Joined: Fri Jun 22, 2018 3:51 am

Re: Gstreamer 1.0 for raspbian

Fri Jun 22, 2018 4:09 am

codestar02 wrote:
Mon Nov 03, 2014 7:54 am
FINALLY got it streaming!

However, the video is extremely choppy, laggy, and fragmented. Is there a way to speed this up? Right now i'm seeing around 4 seconds of delay, and quick movements turn the screen to a mass of blocks.

My goal is an infinite stream onto a second, overclocked b+ pi, that does nothing else but view the video.

Sending line:

Code: Select all

raspivid -f -b 10000000 -fps 30 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse! rtph264pay config-interval=1 pt=96 ! udpsink host=10.3.99.255 port=9000
Receiving line:

Code: Select all

gst-launch-1.0 -v udpsrc port=9000 caps='application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264' ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
Thanks
I read the links provided.....and did a fresh installation of gstreamer-1.0 on Raspbian Sketch thinking the problem was in the gstreamer's package.
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install gstreamer-1.0


while launching the code

Code: Select all

raspivid -f -b 10000000 -fps 30 -t 0 -o - | gst-launch-1.0 -v fdsrc ! h264parse! rtph264pay config-interval=1 pt=96 ! udpsink host=192.168.100.84 port=6000
It stills stops at the same point :

Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

How did you solve that ?

Idrive
Posts: 5
Joined: Sat Jun 30, 2018 9:56 pm

Re: Gstreamer 1.0 for raspbian

Tue Jul 03, 2018 9:14 pm

I've been using gtreamer for over a year. My Rpi Zero W is placed in a model train, and a bash file launches this:

Code: Select all

raspivid -t 0 -w 1920 -h 1080 -fps 20 -b 10000000 -o - | gst-launch-1.0 -e -vvvv fdsrc ! h264parse ! rtph264pay pt=96 config-interval=5 ! udpsink host=192.168.0.103 port=5000
On my Windows laptop I run this

Code: Select all

@echo off
F:\gstreamer\1.0\x86_64\bin\gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! avdec_h264 ! fpsdisplaysink sync=false text-overlay=false
And I used to get a smooth live stream via Wifi with a 0.2 sec delay.
Then, one day I turn everything on and all I get on my laptop is a green picture. I f I move the camera I can see something moving but very sloppy, terrible delay and lots of frozen pictures, all in green.

Between the last time the setup worked and the green picture nothing happened. No updates, nothing, everything's been in a box.

Tried changing the camera module, then changing the Rpi Zero W, then running apt-get update and upgrade, but I keep getting the green picture.

Any ideas?
I'm a newbie, the above commands are the product of hours of research on the net and trial & error. It was awesome till it worked, but now I really don't know what or where to tweak.

Thank you for any help you can provide,
Guido

Return to “Raspbian”

Who is online

Users browsing this forum: DarkElvenAngel and 18 guests