GStreamer access to raw audio data



Hello, all.

First of all, Gtk2, Glib, Gstreamer are all phenomenal bindings. They
have truly turned a spaghetti nightmare into a gizmo paradise. Thank
you.

I'm working on a module to read media files from GStreamer into a PDL
object. (a piddle.)  So far, I've managed to seek accurately, and read
data from an image buffer into a piddle. This is done with a playbin2
and a fakesink for video. playbin2's 'convert-frame' action signal
does the hard part of image conversion.

It doesn't look like it will be that easy for audio. 'convert-frame'
doesn't handle audio caps, and #gstreamer on freenode insists that an
appsink is the way to capture audio. I have a significant problem with
appsink, which is that it appsink methods don't appear to work. My
appsink object is instantiated by the GStreamer::ElementFactory, but
calling, for example, $appsink->pull_preroll() produces this error:

Can't locate object method "gst_app_sink_pull_preroll" via package
"Glib::Object::_Unregistered::GstAppSink" at lib/PDL/GStreamer.pm line
54.

Ideally, I would like access to at least several seconds of audio in a
PCM format, beginning at the seek position, while the playbin2 remains
in the paused state.

So here are my questions:
* Is appsink the best way to dump audio in a PCM format? If so, how?
If not, what's the easiest way?
* This is my first time using GStreamer, and most of my code came from
the totem thumbnailer. Most users use GStreamer to play media rather
than to dump or convert it, so I haven't found many resources for
conversion. PDL::GStreamer is still a small module. Would a code
review be a lot to ask?

  Github link:
https://github.com/zpmorgan/PDL-GStreamer
  Screenshot:
https://github.com/zpmorgan/zpmorgan.github.com/raw/master/pdl-gstreamer-seeking.png

Thanks,
Zach Morgan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]