[gst-devel] mpeg1 playback questions (0.4.0)

Joshua N Pritikin vishnu at pobox.com
Thu Jul 11 12:43:11 CEST 2002


i ported my 0.3.1 video player to 0.4.0.  It was fairly painless, but
i still have some questions:


+ i'm not sure how to do the old seek-by-offset.  Here is my new code:

  GstEvent *ev =
    gst_event_new_seek (GST_SEEK_METHOD_SET|GST_FORMAT_BYTES|
			GST_SEEK_FLAG_FLUSH, offset);
  gst_pad_send_event (gst_element_get_pad (fv->cur_source->elem, "src"), ev);

Does this look correct?  It doesn't work very well.  The player freezes
after a few seeks.  gst-player does much better (i couldn't get it to
freeze at all).

Do i need to route the seek through gstmpegparse.c?  If so, shall i
submit a patch to add seek-by-offset support to gst_mpeg_parse_handle_src_event?


+ How do i translate byte-offset into time-offset?  i see that i can
query the bit_rate, but i'd prefer a simple time-offset API.  Am i
looking for gst_clock_get_time()?


+ The other problem is that the video & audio are out of sync.  This is
not a problem of my machine is too slow.  The player takes about 13% of
my CPU.  mplayer can play DVDs without dropping frames.  There is some
kind of clock sync problem.  Either the video is too slow and the audio
is choppy, or the video is too fast and the audio doesn't play at all.
gst-player has the same problem (but with less severity).

i think i'm missing something basic about clocks.  How do i add a
clock to my pipeline?  What is the new "sync" property in mpegdemux?

-- 
Victory to the Divine Mother!!         after all,
  http://sahajayoga.org                  http://why-compete.org




More information about the gstreamer-devel mailing list