No subject
Johan Basore
johan_dream at hotmail.com
Fri Apr 22 18:28:32 UTC 2016
Hello,
I am building a video editing app for iOS with gstreamer 1.8.1.But I am having a problem with decodebin( especially demux).It says "Error received from element avidemux0 : Internal data stream error.".All types of movies have problem with demux.
Here are my source codes.
GstBus *bus; GSource *bus_source;
GstElement *source1, *clrspace1, *clrspace2, *clrspace, *videobox1, *sink, *source2, *mpegenc, *avimux; GstElement *videomixer; GstElement *decodebin1, *decodebin2; GstElement *queue; //GstElement *matroskademux1, *vorbisdec, *audioconvert, *audioresample, *audiosink; //GstElement *matroskademux1, *vp8dec1, *matroskademux2, *vp8dec2; GST_DEBUG ("Creating pipeline"); /* Create our own GLib Main Context and make it the default one */ context = g_main_context_new (); g_main_context_push_thread_default(context);/****************************************************************************************************************************/ /* Build pipeline */ pipeline = gst_pipeline_new("pipelinecomposer"); source1 = gst_element_factory_make("filesrc", "source1"); source2 = gst_element_factory_make("filesrc", "source2"); videobox1 = gst_element_factory_make("videobox", "videobox"); videomixer = gst_element_factory_make("videomixer", "videomixer"); clrspace1 = gst_element_factory_make("videoconvert", "clrspace1"); clrspace2 = gst_element_factory_make("videoconvert", "clrspace2"); clrspace = gst_element_factory_make("videoconvert", "clrspace"); sink = gst_element_factory_make("filesink", "sink"); mpegenc = gst_element_factory_make("x264enc", "mpegenc"); avimux = gst_element_factory_make("mpegtsmux", "avimux"); decodebin1 = gst_element_factory_make("decodebin", "decodebin1"); decodebin2 = gst_element_factory_make("decodebin", "decodebin2"); queue = gst_element_factory_make("queue", "queue"); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"1.avi"]; NSString *filePath_1 = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"1.webm"]; NSString *filePath_2 = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"2.webm"]; g_object_set (source1, "location", [filePath_1 UTF8String], NULL); g_object_set (source2, "location", [filePath_2 UTF8String], NULL); g_object_set (G_OBJECT (sink), "location", [filePath UTF8String], NULL); if (!mpegenc || !avimux) { GST_DEBUG("No Enc"); } if (!sink) { GST_DEBUG ("No Sink"); } if (!decodebin1) { GST_DEBUG ("No Decodebin"); } /* g_object_set(videobox1,"border-alpha",0,"top",0,"left",0,NULL); gst_bin_add_many(GST_BIN (pipeline), source1, sink, videobox1, videomixer, clrspace1, clrspace2, clrspace, source2, mpegenc, avimux, decodebin1, decodebin2, nil); gst_element_link_many(source1, decodebin1, clrspace1, videobox1, videomixer, clrspace, mpegenc, avimux, sink, nil); gst_element_link_many(source2, decodebin2, clrspace2, videomixer, nil); */ gst_bin_add_many(GST_BIN (pipeline), source1, sink, clrspace1, mpegenc, avimux, decodebin1, queue, nil); gst_element_link_many(source1, decodebin1, queue, clrspace1, mpegenc, avimux, sink, nil); gst_element_set_state(pipeline, GST_STATE_PLAYING); /****************************************************************************************************************************/ /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */ bus = gst_element_get_bus (pipeline); bus_source = gst_bus_create_watch (bus); g_source_set_callback (bus_source, (GSourceFunc) gst_bus_async_signal_func, NULL, NULL); g_source_attach (bus_source, context); g_source_unref (bus_source); g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb, (__bridge void *)self); g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback)state_changed_cb, (__bridge void *)self); gst_object_unref (bus); /* Create a GLib Main Loop and set it to run */ GST_DEBUG ("Entering main loop..."); main_loop = g_main_loop_new (context, FALSE); g_main_loop_run (main_loop); GST_DEBUG ("Exited main loop"); g_main_loop_unref (main_loop); main_loop = NULL; /* Free resources */ g_main_context_pop_thread_default(context); g_main_context_unref (context); gst_element_set_state (pipeline, GST_STATE_NULL); gst_object_unref (pipeline);
Can you help me?My Xcode version is 7.2 and iOS version is 8.1 and 9.2.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160422/23854d06/attachment-0001.html>
More information about the gstreamer-devel
mailing list