Critical warning 'segment->format == format'
philippb.ontour at gmail.com
Fri Nov 11 05:47:53 UTC 2022
It seems you can reproduce this issue with gst-launch, without writing
any code at all, so I would recommend that.
Once you know how to change to pipeline, you can go back to your code example.
About the issue itself,
as it complains about format not being initialized, I would try being
more specfic there. Try:
[...] x24enc ! video/x-h264,profile=constrained-baseline ! h264parse
config-interval=-1 ! mp4mux ! filesink
Note that this might be more than required. It's just meant as a hint
what to try. Also, you probably want mainline, not constrained
baseline in the end.
Am Sa., 5. Nov. 2022 um 02:05 Uhr schrieb amindfv--- via
gstreamer-devel <gstreamer-devel at lists.freedesktop.org>:
> 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
> ... -> 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?
> The diff:
> < GstElement *pipeline, *src, *csp, *vs, *sink;
> > GstElement *pipeline, *src, *csp, *vs, *x264enc, *mp4mux, *filesink;
> < 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);
> < 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);
> < gst_element_link_many (csp, vs, sink, NULL);
> > gst_element_link_many (csp, vs, x264enc, mp4mux, filesink, NULL);
More information about the gstreamer-devel