Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Back  Login

gst-duration-seek-position Diff - Ruby-GNOME2 Project Website

  • Added parts are displayed like this.
  • Deleted parts are displayed like this.


Proof-of-concept Ruby/GStreamer application that could be used to query total duration of an audio file, current position and peform seeking.

Please note that in certain cases (e.g. some VBR encodings), total duration can change. In that case, GStreamer emits signal of type Gst::Message::Type::DURATION - this application doesn't handle that. In most (but not all!) cases, GStreamer would emit one at least once, but you cannot rely on that. Just perform querying after changing the state of the pipeline. Remember that you can query duration only after prerolling (in PAUSED or PLAYING state).


{{image "duration-screenshot.png"}}

$ ruby duration.rb AUDIO_FILE_NAME


Marcin Lewandowski

Initial release