dynamic pipeline, getting not-negotiated error when adding filesink
Tim-Philipp Müller
t.i.m at zen.co.uk
Mon Sep 2 11:51:35 PDT 2013
On Mon, 2013-09-02 at 20:17 +0200, Piotr Szychowski wrote:
Hi Piotr,
> This works:
> gst-launch -e v4l2src ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! tee name=splitter ! queue ! autovideosink splitter. ! queue ! theoraenc ! oggmux ! filesink location=testogg.ogg
>
>
>
> I'm trying to do the same in a dynamic way using python and pygst, the
> autovideosink branch is always there and after user input I want to
> attach the filesink.
>
> fileSink = self.getFileSink() #creates the filesink Bin
> pad = fileSink.get_static_pad('sink')
> pad.set_blocked_async(True, self.padBlockedOnRecordStart, None)
> self.player.add(fileSink)
> fileSink.set_state(gst.STATE_PLAYING)
> self.player.get_by_name('splitter').link(fileSink)
> pad.set_blocked_async(False, self.padBlockedOnRecordStart, None)
>
>
>
> on linking the splitter(tee) to the fileSink Bin I get this error:
>
> Error: GStreamer encountered a general stream error. gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:player/GstV4l2Src:video:
> streaming task paused, reason not-negotiated (-4)
1) are you aware of camerabin2 ? It can handle all this low-level stuff
for you, at least in this case.
2) the problem probably that if you do have a the theoraenc in the
pipeline, it will negotiate a YUV format that works well for the sink
and the source. That YUV format might not be one of the formats
theoraenc accepts. Two possible solutions:
a) add "format=(fourcc){ I420, Y42B, Y444 }" to your capsfilter
b) put an ffmpegcolorspace before theoraenc
3) btw, you probably also want a videorate element in front of theoraenc
to turn the variable framerate stream from v4l2src into a constant
framerate stream, which is what theoraenc needs.
Cheers
-Tim
More information about the gstreamer-devel
mailing list