GTK4 video playback from InputStream

Hi, I have a GInputStream of an mp4 video (returned from libsoup), I am wondering what’s the simplest way to display it with GTK4? I was hoping GtkMediaFile would work, but it asserts if I pass this stream to gtk_media_file_new_for_input_stream:

ERROR:../modules/media/gtkgstmediafile.c:276:gtk_gst_media_file_open: code should not be reached

Would I have to handle the input manually with GStreamer? Thanks!

The comment above that assert is telling:

/* It's an input stream */
g_assert_not_reached ();

Looks like a bug. gtk_media_file_new_for_input_stream() sets the input-stream property, which calls gtk_media_file_set_input_stream(), which calls the open vfunc, which is gtk_gst_media_file_open(). It’s designed to always crash, and that can’t be right.

1 Like

Right. The gtkgstmediafile implementation doesn’t seem to handle input streams at all.

I’m not sure if it works with the ffmpeg backend, it’s not so easy to test as it doesn’t seem to be included in the Flatpak runtime.

I’ll open an issue. Thanks :slight_smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.