Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Eds Savage
this is the repository of my project
in line 308 of the same file "set_window_handle" is called,
I don't know if I'm doing something wrong but it's opening the video in a new window, has anyone used a `winit` window to play a gstreamer video?

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Sebastian Dröge-3
On Fri, 2020-12-18 at 02:43 -0600, Eds Savage wrote:
this is the repository of my project
in line 308 of the same file "set_window_handle" is called,
I don't know if I'm doing something wrong but it's opening the video in a new window, has anyone used a `winit` window to play a gstreamer video?

I can't try it here as it only works on Windows, but that looks like it should work if the handle that is passed there is an actual window handle.
You set it on playbin before the pipeline starts, which should work fine.

Can you provide a debug log with GST_DEBUG=6? Maybe that gives some more information why it doesn't want to use your provided handle.


Also (unrelated) you're doing bus.remove_signal_watch() right after starting the pipeline. That means you will not get any messages on the bus after that anymore, and will certainly never get an EOS message because that will happen much later.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Eds Savage
Is there a way to put these logs in a file (I'm using `cargo run > debug.txt` but the file is empty)? Also how long should I run it for because it seemed endless.

El vie, 18 dic 2020 a las 3:30, Sebastian Dröge (<[hidden email]>) escribió:
On Fri, 2020-12-18 at 02:43 -0600, Eds Savage wrote:
this is the repository of my project
in line 308 of the same file "set_window_handle" is called,
I don't know if I'm doing something wrong but it's opening the video in a new window, has anyone used a `winit` window to play a gstreamer video?

I can't try it here as it only works on Windows, but that looks like it should work if the handle that is passed there is an actual window handle.
You set it on playbin before the pipeline starts, which should work fine.

Can you provide a debug log with GST_DEBUG=6? Maybe that gives some more information why it doesn't want to use your provided handle.


Also (unrelated) you're doing bus.remove_signal_watch() right after starting the pipeline. That means you will not get any messages on the bus after that anymore, and will certainly never get an EOS message because that will happen much later.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Sebastian Dröge-3
On Sat, 2020-12-19 at 01:52 -0600, Eds Savage wrote:
Is there a way to put these logs in a file (I'm using `cargo run > debug.txt` but the file is empty)? Also how long should I run it for because it seemed endless.

You could redirect it with 2> debug.txt or you could set GST_DEBUG_FILE=debug.txt

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Eds Savage
This is the debug output, I only ran it for less than 5 minutes but let me know if you require me to run it for a longer period.

El sáb, 19 dic 2020 a las 3:21, Sebastian Dröge (<[hidden email]>) escribió:
On Sat, 2020-12-19 at 01:52 -0600, Eds Savage wrote:
Is there a way to put these logs in a file (I'm using `cargo run > debug.txt` but the file is empty)? Also how long should I run it for because it seemed endless.

You could redirect it with 2> debug.txt or you could set GST_DEBUG_FILE=debug.txt

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Sebastian Dröge-3
On Sat, 2020-12-19 at 18:44 -0600, Eds Savage wrote:
This is the debug output, I only ran it for less than 5 minutes but let me know if you require me to run it for a longer period.

This is a bug in d3d11videosink. It's already expecting the window handle to be set before reaching READY state, while it should wait until PAUSED.

playbin is creating d3d11videosink, setting its state to READY and only if that doesn't fail it is adding it to itself and would be able to set the window handle.
But at that point d3d11videosink expects the window handle to be set already, so instead it created its own window.


-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Sebastian Dröge-3
On Sun, 2020-12-20 at 12:06 +0200, Sebastian Dröge wrote:
On Sat, 2020-12-19 at 18:44 -0600, Eds Savage wrote:
This is the debug output, I only ran it for less than 5 minutes but let me know if you require me to run it for a longer period.

This is a bug in d3d11videosink. It's already expecting the window handle to be set before reaching READY state, while it should wait until PAUSED.

playbin is creating d3d11videosink, setting its state to READY and only if that doesn't fail it is adding it to itself and would be able to set the window handle.
But at that point d3d11videosink expects the window handle to be set already, so instead it created its own window.


Ah I forgot to add. A workaround for that would be to explicitly create d3d11videosink in your code, set the window handle on it and then set it for the "video-sink" property of playbin.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Eds Savage
that did it! thanks a lot for the help. I have one more question, i'm trying to set_render_rectangle, I tried on both the created sink and the playbin casted to VideoOverlay but neither worked, here's the code 

El dom, 20 dic 2020 a las 4:07, Sebastian Dröge (<[hidden email]>) escribió:
On Sun, 2020-12-20 at 12:06 +0200, Sebastian Dröge wrote:
On Sat, 2020-12-19 at 18:44 -0600, Eds Savage wrote:
This is the debug output, I only ran it for less than 5 minutes but let me know if you require me to run it for a longer period.

This is a bug in d3d11videosink. It's already expecting the window handle to be set before reaching READY state, while it should wait until PAUSED.

playbin is creating d3d11videosink, setting its state to READY and only if that doesn't fail it is adding it to itself and would be able to set the window handle.
But at that point d3d11videosink expects the window handle to be set already, so instead it created its own window.


Ah I forgot to add. A workaround for that would be to explicitly create d3d11videosink in your code, set the window handle on it and then set it for the "video-sink" property of playbin.

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Help: I'm trying to play a video with gstreamer in a `winit` window (my application's window), but it opens a new window instead

Sebastian Dröge-3
On Sun, 2020-12-20 at 20:15 -0600, Eds Savage wrote:
that did it! thanks a lot for the help. I have one more question, i'm trying to set_render_rectangle, I tried on both the created sink and the playbin casted to VideoOverlay but neither worked, here's the code 

That API is not supported by playbin and also not by d3d11videosink yet, see: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1416

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel