splitmuxsink

jtag msa6886 at gmail.com
Thu Mar 30 04:32:36 UTC 2017


Hi guys. Sorry for my bad english. I want to record multi files with
splitmuxsink, but  i can't find example on C. After running my program,
program informs:

(hello:2629): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT
(object)' failed
(hello:2629): GLib-GObject-CRITICAL **: g_object_set: assertion 'G_IS_OBJECT
(object)' failed
(hello:2629): GStreamer-CRITICAL **: gst_bin_add_many: assertion
'GST_IS_ELEMENT (element_1)' failed
(hello:2629): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(hello:2629): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
'G_TYPE_CHECK_INSTANCE (instance)' failed
(hello:2629): GStreamer-CRITICAL **: gst_element_link_many: assertion
'GST_IS_ELEMENT (element_1)' failed
(hello:2629): GStreamer-CRITICAL **: gst_bin_add_many: assertion
'GST_IS_ELEMENT (element_1)' failed
(hello:2629): GLib-GObject-WARNING **: invalid (NULL) pointer instance
(hello:2629): GLib-GObject-CRITICAL **: g_signal_connect_data: assertion
'G_TYPE_CHECK_INSTANCE (instance)' failed
(hello:2629): GStreamer-CRITICAL **: gst_element_link_many: assertion
'GST_IS_ELEMENT (element_1)' failed
11Running...

My code:

struct _channel 
{
  GstElement *pipeline;
  GstElement *source;
  GstElement *queue;
  GstElement *depayer;
  GstElement *muxer;
  GstElement * splitmux;
} ;
struct _channel channel[32];

channel[i].splitmux  = gst_element_factory_make ("splitmuxsink",     
"file-output");
g_object_set (channel[0].splitmux, "location",
"/home/jtag/Documents/cam/movie%05d.mp4", NULL);

g_signal_connect (channel[i].splitmux, "format-location",
G_CALLBACK(on_format_location), NULL);

gchar* on_format_location(GstElement *splitmux, guint fragment_id, gpointer
user_data)
{
  //i don't know to write here for me
}

gst_bin_add_many (GST_BIN (channel[i].pipeline), channel[i].source,
channel[i].queue, channel[i].depayer, channel[i].splitmux, NULL);


gst_element_link_many (channel[i].queue, channel[i].depayer,
channel[i].splitmux);

while(1){
    usleep(100000);
    gst_element_set_state (channel[0].pipeline, GST_STATE_PLAYING);
    gst_element_set_state (channel[1].pipeline, GST_STATE_
    g_main_context_iteration(NULL,FALSE); 
  }




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/splitmuxsink-tp4682454.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list