GstRtspServer.RTSPServer on Raspberry Pi [Python]
marcin at saepia.net
marcin at saepia.net
Thu Mar 24 22:54:12 UTC 2016
Regarding language: you can give a try to Vala (http://live.gnome.org/Vala).
It has Java-like syntax, but internally compiles down to C, producing fast
native code, which may make sense in environments such as rpi. It has very
good support for GStreamer and other libraries from GLib family.
In terms of your issue:
1) rtsp server: in order to pass data to the RTSP server, you have to end
pipeline with RTP payloader, e.g. rtpopuspay with name payN where N is
0..n. Your current playbin call won't fit into this requirement.
2) receiver: try to play it with playbin or even gst-play-1.0 command
first. Regardless of that, I think your pipeline lacks further elements
after rtspsrc.
m.
2016-03-20 18:26 GMT+01:00 Vassiliev <Valera.Vassiliev at gmail.com>:
> Hello,
>
> I want to stream video from my RPi's camera to my PC via Internet (Not
> local
> network). I found that I can use RTSP server for that reason.
> Firstly I tried to stream RPi cam's video on the localhost via TCP, than
> server receives it and sharing (Or it just I thought that it will work like
> this) combining founded info. But nothing happend and I decided to sort out
> with server first.
>
> The other problem is that my knowledge of C is pretty poor and I use
> Python,
> while 9 of 10 examples are on C. So, here is the code that should stream
> sample_video.mp4. Later I am going to change that line for rpicamsrc
> plugin.
>
> #!/usr/bin/env python
> import gi
> gi.require_version('Gst', '1.0')
> gi.require_version('GstRtspServer', '1.0')
> from gi.repository import Gst, GObject, GstRtspServer
>
> GObject.threads_init()
> Gst.init(None)
>
> class RTSP_Server:
> def __init__(self):
> self.server = GstRtspServer.RTSPServer.new()
> self.address = '192.168.1.13' #my RPi's local IP
> self.port = '8554'
> self.launch_description = '( playbin
> uri=file:///home/pi/sample_video.mp4 )'
>
> self.server.set_address(self.address)
> self.server.set_service(self.port)
> self.factory = GstRtspServer.RTSPMediaFactory()
> self.factory.set_launch(self.launch_description)
> self.factory.set_shared(True)
> self.mount_points = self.server.get_mount_points()
> self.mount_points.add_factory('/video', self.factory)
>
> self.server.attach(None)
> print('Stream ready')
> GObject.MainLoop().run()
>
>
> server = RTSP_Server()
>
> Then on PC I launch this gst-launch-1.0 -v rtspsrc
> location=rtsp://192.168.1.13:8554/video (Likely it is not full but I dont
> know what to write else). And get this:
>
> C:\gstreamer\1.0\x86_64\bin>gst-launch-1.0 -v rtspsrc
> location=rtsp://192.168.1.
> 13:8554/video
> Setting pipeline to PAUSED ...
> Pipeline is live and does not need PREROLL ...
> Progress: (open) Opening Stream
> Progress: (connect) Connecting to rtsp://192.168.1.13:8554/video
> Progress: (open) Retrieving server options
> Progress: (open) Retrieving media info
> ERROR: from element /GstPipeline:pipeline0/GstRTSPSrc:rtspsrc0: Could not
> get/se
> t settings from/on resource.
> Additional debug info:
> gstrtspsrc.c(6845): gst_rtspsrc_setup_streams ():
> /GstPipeline:pipeline0/GstRTSP
> Src:rtspsrc0:
> SDP contains no streams
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to PAUSED ...
> Setting pipeline to READY ...
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
>
> So, guys, what should I do?
> Thnx in advance,
> Valeriy
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/GstRtspServer-RTSPServer-on-Raspberry-Pi-Python-tp4676461.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160324/ea36e012/attachment-0001.html>
More information about the gstreamer-devel
mailing list