<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>For the errors:<br>
    </p>
    <pre class="moz-quote-pre" wrap="">Error : Gstreamer Critical gst_segment_do_seek assertion segment->format ==
format failed</pre>
    <p>
      I would recommend checking which format are you passing in the
      seek. Fx I have successfully used Gst.Format.TIME<br>
    </p>
    <div style="color: #d4d4d4;background-color: #1e1e1e;font-family: 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback';font-weight: normal;font-size: 14px;line-height: 19px;white-space: pre;"><div><span style="color: #c586c0;">if</span><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">not</span><span style="color: #d4d4d4;"> </span><span style="color: #9cdcfe;">pipe</span><span style="color: #d4d4d4;">.seek(</span><span style="color: #9cdcfe;">rate</span><span style="color: #d4d4d4;">, Gst.Format.TIME, </span></div><div><span style="color: #d4d4d4;">             (Gst.SeekFlags.FLUSH | Gst.SeekFlags.ACCURATE),</span></div><div><span style="color: #d4d4d4;">             Gst.SeekType.SET, </span><span style="color: #9cdcfe;">pos</span><span style="color: #d4d4d4;"> * Gst.SECOND , </span><span style="color: #9cdcfe;">seek_type</span><span style="color: #d4d4d4;">, </span><span style="color: #9cdcfe;">end</span><span style="color: #d4d4d4;"> * Gst.SECOND):</span></div><div><span style="color: #d4d4d4;">            </span><span style="color: #dcdcaa;">print</span><span style="color: #d4d4d4;">(</span><span style="color: #ce9178;">"Seeking failed"</span><span style="color: #d4d4d4;">)</span></div><div><span style="color: #d4d4d4;">            </span><span style="color: #6a9955;">#Gst.debug_set_threshold_from_string("*:3", True)</span></div><div><span style="color: #d4d4d4;">            </span><span style="color: #c586c0;">return</span><span style="color: #d4d4d4;"> </span><span style="color: #569cd6;">False</span></div></div>
    <p>And I don't think I ever managed to make seek working in my case
      unless the pipeline was in PLAYING state.</p>
    <p>Also from experience I have only had seeking working on demuxed
      data, but that you seem to have.</p>
    <p>And I also tend to start my seeking procedure by doing a query of
      position and duration, partially because I wanted to seek to X
      seconds ago instead of a absolute position.<br>
      But also because from experience: if the queries fail the seek
      won't work.</p>
    <p>Lastly I can only recommend to make your pipeline as small as
      possible and test.<br>
      And then increase element by element...</p>
    <p>Like this doesnt work because data is still muxed: "filesrc
      name=replay location=/home/msb/test.ts ! fakesink"</p>
    <p>While this should work: "filesrc name=replay
      location=/home/msb/test.ts ! tsdemux ! fakesink"</p>
    <p>But then for correct playback speed: "fakesink sync=true" or
      "filesrc name=replay location=/home/msb/test.ts ! tsdemux !
      identity sync=true ! fakesink"</p>
    <div class="moz-cite-prefix">On 01.11.2021 13.00,
      <a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel-request@lists.freedesktop.org">gstreamer-devel-request@lists.freedesktop.org</a> wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:mailman.34.1635768003.421.gstreamer-devel@lists.freedesktop.org">
      <pre class="moz-quote-pre" wrap="">Hi,

When executing a flushing seek with reply true on a paused pipeline I get
next error, but seek seems to be executed.

Error : Gstreamer Critical gst_segment_do_seek assertion segment->format ==
format failed

When executing a flushing seek with reply true on running pipeline I get
next errors, and seek is not executed

Error :  Gstreamer Critical gst_segment_do_seek assertion segment->format
== format failed
Warn : qtmux.c 1931:  gst_qt_mux_send_buffer:<muxer> Failed to send buffer
Error : qtmux.c 4214: gst_qt_mux_pad_fragment_add_buffer:<mux> Failed to
send fragment

The seek is a time based with options GST_SEEK_FLAG_FLUSH |
GST_SEEK_FLAG_KEY_UNIT | GST_SEEK_FLAG_SEGMENT

Pipeline :
filesrc ! qtdemux  ! h264parse ! avdec_264  ! x264enc bitrate=1024 ! qtmux
fragment-duration=100 !  multisocketsink

I tried some settings as mentioned in gstreamer archives, but problem
remains.
- gst_base_src_set_format ((GstBasesrc *) filesrc , GST_FORMAT_TIME )
- on Qtmux streamable = TRUE
- on filesrc do-timestamp = TRUE
-  on multisocketsink sync = TRUE

Used Gstreamer version 1.18.5 msdev 32 bit.

What can I do, or what am I doing wrong to perform a valid seek

Cheers,
Marc</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
Best regards / Med venlig hilsen
“Marianna Smidth Buschle”</pre>
  </body>
</html>