[gst-devel] gst_bin_add_many: assertion `GST_IS_ELEMENT (element_1)' failed

Marlos C. Machado marlos at dcc.ufmg.br
Fri Oct 22 19:01:56 CEST 2010


Hi,

I need to implement this following stream on C++:
filesrc location=Video2.avi ! decodebin2 name=dec ! queue !
ffmpegcolorspace ! autovideosink dec. !	char audio [] = "queue !
audioconvert ! audioresample ! autoaudiosink
	
I've done this simple code:

int main(int argc, char ** argv)
{
        GError *error = NULL;
	GstElement *gstInit, *gstVideo, *gstAudio;
	GstElement *video_stream, *filesrc, *decodebin2, *queue_1, *ffmpegcolorspace;
	GstElement *autovideosink, *queue_2, *audioconvert, *audioresample,
*autoaudiosink;
	
	gst_init(&argc, &argv);

        video_stream = gst_pipeline_new("Video");
	
	filesrc          = gst_element_factory_make("filesrc
location=Video2.avi", "filesrc");
	decodebin2       = gst_element_factory_make("decodebin2 name=dec",
"decodebin2");
	queue_1          = gst_element_factory_make("queue", "queue1");
	ffmpegcolorspace = gst_element_factory_make("ffmpegcolorspace",
"ffmpegcolorspace");
	autovideosink    = gst_element_factory_make("autovideosink dec.",
"autovideosink");
	queue_2          = gst_element_factory_make("queue", "queue2");
	audioconvert     = gst_element_factory_make("audioconvert", "audioconvert");
	audioresample    = gst_element_factory_make("audioresample", "audioresample");
	autoaudiosink    = gst_element_factory_make("autoaudiosink", "autoaudiosink");

	gst_bin_add_many(GST_BIN(video_stream), filesrc, decodebin2, queue_1,
ffmpegcolorspace,
			             autovideosink, queue_2, audioconvert, audioresample,
autoaudiosink, NULL);

}

It compiles, but when I try to run I get this:
(playVideo:4190): GStreamer-CRITICAL **: gst_bin_add_many: assertion
`GST_IS_ELEMENT (element_1)' failed

What Am I doing wrong?

Thanks in advance.



-- 
Marlos Cholodovskis Machado




More information about the gstreamer-devel mailing list