format-location signals of splitmuxsink

Stephenwei lofy.stephen at gmail.com
Thu Mar 12 08:45:01 UTC 2020


Hi,
My GStreamer version is 1.14.4
I try to used format-location of splitmuxsink to split the mp4 file
the parameter as below:
    GstElement* mux = gst_element_factory_make("mp4mux", "mux");
    g_object_set(G_OBJECT(splitmuxsink), "muxer", mux, NULL);
    g_object_set(G_OBJECT(splitmuxsink), "max-files", 60, NULL);
    g_object_set(G_OBJECT(splitmuxsink), "max-size-time", 1000000000, NULL);
    g_object_set(G_OBJECT(splitmuxsink), "location", "/tmp/video/%03d.mp4",
NULL);
g_signal_connect(splitmuxsink, "format-location-full", G_CALLBACK
(cb_splitmuxsink_format_location), NULL)

gchar* cb_splitmuxsink_format_location (GstElement splitmuxsnik, guint 
fragment_id, gpointer udata)
{
    struct tm *local;
    time_t t;
    t=time(NULL);
    local=localtime(&t);
    gchar time_name[40];
    snprintf(time_name, 40, "/tmp/video/%03d.mp4", local->tm_sec);
    printf("time_name=%s\n",(gchar*)time_name); // show the sec time
    return (gchar*)time_name;
}

it seems work, but the generated file always start by 000.mp4
It seems to follow location instead of format-location

Thanks




-----
GStreamer is a convenient multimedia platform, I like it. 
Develop the NVR system on ARM/x86(c/python)
Use python to generate NVR is crazy, of course works fine.

--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list