Record and take picture issue
Sérgio Agostinho
sergio.r.agostinho at gmail.com
Sat Nov 29 07:44:01 PST 2014
Should it not be
self.ipad_a = self.inselect.get_request_pad("sink%d")
self.ipad_b = self.inselect.get_request_pad("sink%d”)
They’re sink pads not source pads.
Sérgio
> On 29 Nov 2014, at 16:35, Chiheb Djabri <iceonfire29 at gmail.com> wrote:
>
> Hi
>
> I am a Gstreamer newbie and I createrd a Python Gtk application and then I created a gst pipeline for streaming from webcam. This work fine. I also create another pipeline for recording and taking picture. I have the following elements:
>
> /-----jpegenc---
> / \
> ximagesrc--- ffmpegcolorspace --- output-selector---/-------mp4mux---input-selector---filesink
>
>
> The problem is that i can't link elements together (I am not really sure of what I am doing). Here is my code:
>
> def __init_rec_pipeline(self):
> self.rec_pipeline = gst.Pipeline("rec-pipeline")
> bus = self.rec_pipeline.get_bus()
> bus.enable_sync_message_emission()
> bus.add_signal_watch()
> bus.connect("message", self.gst_bus_message)
>
> src = gst.element_factory_make("ximagesrc", "src")
> src.set_property("xid", self.window.xid)
>
> conv = gst.element_factory_make("ffmpegcolorspace", "ffmpegcolorspace")
> self.inselect = gst.element_factory_make("input-selector", "inselect")
> self.outselect = gst.element_factory_make("output-selector", "outselect")
> jpegenc = gst.element_factory_make("jpegenc", "jpegenc")
> mp4mux = gst.element_factory_make("mp4mux", "mp4mux")
> sink = gst.element_factory_make("filesink", "sink")
>
> self.rec_pipeline.add(src, conv, self.outselect, mp4mux, jpegenc, self.inselect, sink)
> src.link(conv)
> conv.link(self.outselect)
>
> self.opad_a = self.outselect.get_request_pad("src%d")
> self.opad_b = self.outselect.get_request_pad("src%d")
>
> jpegenc.add_pad(self.opad_a)
> mp4mux.add_pad(self.opad_b)
>
> self.inselect.link(sink)
>
> self.ipad_a = self.inselect.get_request_pad("src%d")
> self.ipad_b = self.inselect.get_request_pad("src%d")
>
> jpegenc.add_pad(self.ipad_a)
> mp4mux.add_pad(self.ipad_b)
>
> The code fail at the last two lines because I can't obtain pads from input-selector.
> Any idea ?
>
> Any help or suggestion is welcome.
> Thanks in advance
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20141129/21cd858f/attachment-0001.html>
More information about the gstreamer-devel
mailing list