Audio only playback with playbin

hjuvi freedesktop-ml at
Tue Jan 3 09:36:56 UTC 2023


I'm writing a terminal-based audio player application based on GStreamer (currently testing with
version 1.20.4).

This is really intended to be an audio player only, but I'd like to be able to play the audio part
of an audio/video file.
For this purpose, I'm using a fake sink for the video, to avoid having a popup window with the

My player works perfectly for pure audio files, but I have some problems with audio/video files. It
plays correctly if I just let it play, but:
- It seems that I don't receive the EOS message (only 'about-to-finish').
- If I try to seek, it works for a moment, but then it ends up getting lost, with strange
behaviours (position not updated, audio freeze or acceleration), and most of the time it freezes
completely (the main loop is blocked).

I'm seeking with (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT) flags.

My questions are:
1) Is the playbin appropriate for this purpose? I find it very convenient, so I hope it is not
necessary to build the pipeline for audio only.
2) Is the fake sink (fakesink or fakevideosink) the right solution to disable video? (I used
fakevideosink because the behaviour was even worse with fakesink).
3) Does the fake sink just disable the output, or does it saves the video decoding (which would be
4) Am I using the right flags to seek? (GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT)
5) If there is no obvious error in what I've done, would you suggest any method to debug this?
(additional traces...)

In case it might help to understand, the source code is here:
And all the calls to GStreamer are done in this particular file:

Thanks a lot for your help.


More information about the gstreamer-devel mailing list