<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hello,<div><br></div><div>I am building a video editing app for iOS with gstreamer 1.8.1.</div><div>But I am having a problem with decodebin( especially demux).</div><div>It says "Error received from element avidemux0 : Internal data stream error.".</div><div>All types of movies have problem with demux.</div><div><br></div><div>Here are my source codes.</div><div><br></div><div><div> GstBus *bus;</div><div> GSource *bus_source;</div><div><br></div><div> GstElement *source1, *clrspace1, *clrspace2, *clrspace, *videobox1, *sink, *source2, *mpegenc, *avimux;</div><div> GstElement *videomixer;</div><div> GstElement *decodebin1, *decodebin2;</div><div> GstElement *queue;</div><div> //GstElement *matroskademux1, *vorbisdec, *audioconvert, *audioresample, *audiosink;</div><div> //GstElement *matroskademux1, *vp8dec1, *matroskademux2, *vp8dec2;</div><div> </div><div> </div><div> GST_DEBUG ("Creating pipeline");</div><div> </div><div> /* Create our own GLib Main Context and make it the default one */</div><div> context = g_main_context_new ();</div><div> g_main_context_push_thread_default(context);</div><div>/****************************************************************************************************************************/</div><div> /* Build pipeline */</div><div> pipeline = gst_pipeline_new("pipelinecomposer");</div><div> source1 = gst_element_factory_make("filesrc", "source1");</div><div> source2 = gst_element_factory_make("filesrc", "source2");</div><div> videobox1 = gst_element_factory_make("videobox", "videobox");</div><div> videomixer = gst_element_factory_make("videomixer", "videomixer");</div><div> clrspace1 = gst_element_factory_make("videoconvert", "clrspace1");</div><div> clrspace2 = gst_element_factory_make("videoconvert", "clrspace2");</div><div> clrspace = gst_element_factory_make("videoconvert", "clrspace");</div><div> sink = gst_element_factory_make("filesink", "sink");</div><div> mpegenc = gst_element_factory_make("x264enc", "mpegenc");</div><div> avimux = gst_element_factory_make("mpegtsmux", "avimux");</div><div> decodebin1 = gst_element_factory_make("decodebin", "decodebin1");</div><div> decodebin2 = gst_element_factory_make("decodebin", "decodebin2");</div><div> queue = gst_element_factory_make("queue", "queue");</div><div> <span style="font-size: 12pt;"> </span></div><div> NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);</div><div> NSString *documentsDirectory = [paths objectAtIndex:0];</div><div> NSString *filePath = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"1.avi"];</div><div> </div><div> NSString *filePath_1 = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"1.webm"];</div><div> NSString *filePath_2 = [NSString stringWithFormat:@"%@/%@", documentsDirectory, @"2.webm"];</div><div> </div><div> g_object_set (source1, "location", [filePath_1 UTF8String], NULL);</div><div> g_object_set (source2, "location", [filePath_2 UTF8String], NULL);</div><div> </div><div> g_object_set (G_OBJECT (sink), "location", [filePath UTF8String], NULL);</div><div> </div><div> if (!mpegenc || !avimux) {</div><div> GST_DEBUG("No Enc");</div><div> }</div><div> if (!sink) {</div><div> GST_DEBUG ("No Sink");</div><div> }</div><div> </div><div> if (!decodebin1) {</div><div> GST_DEBUG ("No Decodebin");</div><div> }</div><div> </div><div> /*</div><div> g_object_set(videobox1,"border-alpha",0,"top",0,"left",0,NULL);</div><div> </div><div> gst_bin_add_many(GST_BIN (pipeline), source1, sink, videobox1, videomixer, clrspace1, clrspace2, clrspace, source2, mpegenc, avimux, decodebin1, decodebin2, nil);</div><div> </div><div> gst_element_link_many(source1, decodebin1, clrspace1, videobox1, videomixer, clrspace, mpegenc, avimux, sink, nil);</div><div> gst_element_link_many(source2, decodebin2, clrspace2, videomixer, nil);</div><div> */</div><div> gst_bin_add_many(GST_BIN (pipeline), source1, sink, clrspace1, mpegenc, avimux, decodebin1, queue, nil);</div><div> </div><div> gst_element_link_many(source1, decodebin1, queue, clrspace1, mpegenc, avimux, sink, nil);</div><div> </div><div> gst_element_set_state(pipeline, GST_STATE_PLAYING);</div><div> </div><div>/****************************************************************************************************************************/</div><div> /* Instruct the bus to emit signals for each received message, and connect to the interesting signals */</div><div> bus = gst_element_get_bus (pipeline);</div><div> bus_source = gst_bus_create_watch (bus);</div><div> g_source_set_callback (bus_source, (GSourceFunc) gst_bus_async_signal_func, NULL, NULL);</div><div> g_source_attach (bus_source, context);</div><div> g_source_unref (bus_source);</div><div> g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb, (__bridge void *)self);</div><div> g_signal_connect (G_OBJECT (bus), "message::state-changed", (GCallback)state_changed_cb, (__bridge void *)self);</div><div> gst_object_unref (bus);</div><div> </div><div> /* Create a GLib Main Loop and set it to run */</div><div> GST_DEBUG ("Entering main loop...");</div><div> main_loop = g_main_loop_new (context, FALSE);</div><div> g_main_loop_run (main_loop);</div><div> GST_DEBUG ("Exited main loop");</div><div> g_main_loop_unref (main_loop);</div><div> main_loop = NULL;</div><div> </div><div> /* Free resources */</div><div> g_main_context_pop_thread_default(context);</div><div> g_main_context_unref (context);</div><div> gst_element_set_state (pipeline, GST_STATE_NULL);</div><div> gst_object_unref (pipeline);</div></div><div><br></div><div><br></div><div>Can you help me?</div><div>My Xcode version is 7.2 and iOS version is 8.1 and 9.2.</div><div><br></div><div>Thanks</div> </div></body>
</html>