Critical warning 'segment->format == format'

amindfv at mailbox.org amindfv at mailbox.org
Sat Nov 5 01:05:35 UTC 2022


Hello,
I've taken - verbatim - the "Play a section of a media file" example from the Pipeline Manipulation docs in the Application Development guide, and changed it to output to a file instead of to an autovideosink (I've pasted the full diff below).

I've simply changed the graph from:

    ... -> videoscale -> autovideosink

to

    ... -> videoscale -> x24enc -> mp4mux -> filesink

This works(!) and correctly outputs a playable .mp4 file; however, it gives an ominous "CRITICAL" warning, that I've run into previously right before hitting bigger trouble:

    (pipeline-manipulation:216811): GStreamer-CRITICAL **: 17:49:27.405: gst_segment_do_seek: assertion 'segment->format == format' failed

What's going on here? What else do I need to do to correctly output to a file?

Thanks,
Tom

---

The diff:

    119c122
    <   GstElement *pipeline, *src, *csp, *vs, *sink;
    ---
    >   GstElement *pipeline, *src, *csp, *vs, *x264enc, *mp4mux, *filesink;
    152,154c155,165
    <   sink = gst_element_factory_make ("autovideosink", "sink");
    <   if (sink == NULL)
    <     g_error ("Could not create 'autovideosink' element");
    ---
    >   x264enc = gst_element_factory_make("x264enc", "x264enc");
    >   if (x264enc == NULL)
    >     g_error ("Could not create 'x264enc' element");
    >   mp4mux = gst_element_factory_make("mp4mux", "mp4mux");
    >   if (mp4mux == NULL)
    >     g_error ("Could not create 'mp4mux' element");
    >   filesink = gst_element_factory_make("filesink", "filesink");
    >   if (filesink == NULL)
    >     g_error ("Could not create 'filesink' element");
    >
    >   g_object_set (filesink, "location", "/home/foo/bar.mp4", NULL);
    156c167
    <   gst_bin_add_many (GST_BIN (pipeline), src, csp, vs, sink, NULL);
    ---
    >   gst_bin_add_many (GST_BIN (pipeline), src, csp, vs, x264enc, mp4mux, filesink, NULL);
    159c170
    <   gst_element_link_many (csp, vs, sink, NULL);
    ---
    >   gst_element_link_many (csp, vs, x264enc, mp4mux, filesink, NULL);


More information about the gstreamer-devel mailing list