What is GstPlay used for?

I’m watching documentation about Gstreamer GstPlay. It’sthe successor of GstPlayer and offers convenient playback APIs. I think it’s just something like playbin. But I’m quite confused about:

  1. Can we use GstPlay with other elements or pipelines and use those playback APIs? It seems we can only choose the video render for it.
  2. Does it support streaming, or streaming playback? For example, with rtsp.
  3. I have problems using GstPlay to play local video files but no problem while play the web video sample. Is it not fit for playing local video files?

For Q3, here is my code sample (in gstreamer-rs rust code):

    // Unable to load and play local files. Error Message: Error! Failed to play
    let uri = "D:/Download/test.mp4";
    // Play and render for web URL successfully.
    // let uri =
    //     "https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm";

    match main_loop(uri) {
        Ok(r) => r,
        Err(e) => eprintln!("Error! {e}"),

I can’t find more from the documentation. Wonder anyone knows some insights about this. Thanks:)

GstPlay is a high-level API meant to be used mostly for media player apps. It is indeed the successor of GstPlayer which is going to be deprecated and eventually removed.

  1. Right, it’s mostly targetted at simple media player apps. If you need integration with other pipelines imho GstPlay might not be a good fit.
  2. Yes
  3. What is main_loop doing? The GST_DEBUG=3 logs might give some clues.
1 Like

Thanks for anwsers. Sovles my puzzles. For Q3 I look into the log and change the file path to uri format with file:///D:/Download/text.mp4 and it works.

Above all, I wonder what level of streaming support GstPlay offers. for a streaming situation like playing video files streaming from Gstreamer build-in rtsp server, if I use GstPlay playback APIs on the client side, will it handle communcation automatically and let server side do things like seek position or change audio track?

It’s just a wrapper around playbin / playbin3, and supports anything that these elements support (including seeking over RTSP via rtspsrc, for example).

1 Like