JooPo
Posts: 1
Joined: Mon Nov 16, 2015 11:29 am

Python + PiCamera + Gstreamer

Mon Nov 16, 2015 12:14 pm

I'm trying to stream video from Raspis camera to my computer via udp. I'm using PiCamera and Gstreamer on python, so I can control them both directly and easily from the code. The problem is, I can't pipe the stream from the PiCamera to gstreamer like in the command prompt. The problematic part of my code is here:

Code: Select all

stream = io.BytesIO()
camera = picamera.PiCamera()
camera.start_recording(stream, format='h264', quality=23)
pipeline = Gst.Pipeline()
src = Gst.ElementFactory.make("fdsrc", None)
src.set_property("fd", stream)
pipeline.add(src)
The pipe works from the first ElementFactory, I've tried it on command prompt. The camera works also. The question is, how can I stream the video from PiCamera in a way, that I can read it with Gstreamer and stream is forward?

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Python + PiCamera + Gstreamer

Mon Nov 16, 2015 3:39 pm

No experience with PiCamera or Gstreamer unfortunately. As a last resort you could maybe look at running your command prompt incantations using subprocess?
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Return to “Python”