Audio only playback with playbin

Stephane Cerveau scerveau at
Tue Jan 3 14:57:11 UTC 2023

Dear Cedric,

1) 2) 3)One option to solve your issue(s) would be to redesign a little 
bit your player to use the gst-player API, which will abstract a lot of 
facilities for you: 
You can check the code of gst-play-1.0

You can give a try to `gst-play-1.0 YOUR_AV_FILE --videosink=fakesink` 
for example.

5) to debug I recommend you to read

Best regards.


On 3/1/23 10:36, hjuvi via gstreamer-devel wrote:
> Hello,
> 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
> video.
> 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
> useless)?
> 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.
> --
> Cédric

More information about the gstreamer-devel mailing list