splitmuxsink

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

splitmuxsink

jtag
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);
  }
Reply | Threaded
Open this post in threaded view
|

Re: splitmuxsink

Sebastian Dröge-3
On Wed, 2017-03-29 at 21:32 -0700, jtag wrote:
> 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
> [...]

Somewhere you're calling g_object_set() and others on a NULL pointer.
Check in your code where that happens and why (e.g. an element can't be
found).

For that you can also run in a debugger after setting
G_DEBUG=fatal_warnings in the environment. The application will go into
the debugger on each of these critical warnings then.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (981 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

AW: splitmuxsink

Thornton, Keith
In reply to this post by jtag
One problem seems to me to be that you add splitmuxsink to channel i and then you call g_object_set for channel 0. We don't know what I is equal to. Then at the end you set channel 0 and 1 to playing.

-----Ursprüngliche Nachricht-----
Von: gstreamer-devel [mailto:[hidden email]] Im Auftrag von jtag
Gesendet: Donnerstag, 30. März 2017 06:33
An: [hidden email]
Betreff: splitmuxsink

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.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel