intel / gstreamer-media-SDK

GNU Lesser General Public License v2.1
90 stars 53 forks source link

mfxsink does not display on multiple screens on Debian Linux #126

Closed skyline220 closed 6 years ago

skyline220 commented 6 years ago

Hardware: UP Squared Maker Board (Intel Pentium N4200 Processor)

OS: Ubuntu 16.04 LTS Kernel: 4.14.16 Upgraded according to: https://software.intel.com/en-us/articles/build-and-debug-open-source-media-stack

Install completed using this repo.

In the terminal:

gst-inspect-1.0 mfxvpp Command Succeeds

gst-inspect-1.0 mfxdecode Command Succeeds

gst-launch-1.0 udpsrc port=5000 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! mfxdecode ! mfxsink fullscreen=true

Command Succeeds only on one monitor

I would like to display another fullscreen stream via g-streamer on the second monitor connected for the system but I am unable to find anything with mfxsink to allow me to do it.

I have also tried:

--geometry flag and moving the window the x,y position to 1920,0 respectively. This doesn't work as the --geometry flag isnt accepted via gstreamer.

echo $DISPLAY returns 0:0

xrandr returns two displays where the second display starts at 1920,0

Could anyone please advise on how I can get each feed using mfxsink fullscreen=true onto two distinct monitors?

Please advise as I am really stuck.

Thanks

ishmael1985 commented 6 years ago

@skyline220 instead of using mfxsink, try using mfxsinkelement display-name=:0.1 for the second display, mfxsinkelement display-name=:0.0 is to show it for the first display.

skyline220 commented 6 years ago

Hi Ishmael thanks for your response, I will try this within a day or two when I am back in the office. However there is no display-name 0:1 when I try in the terminal echo $DISPLAY, just 0:0. When I tried googling it it said sometimes the X11 renderer can treat the two individual screens as one big display, as xrandr seems to indicate. In the event that your solution doesn't work do you have any thoughts for if there is just one display 0:0 where the second display starts at 1920x0 for x,y respectively?

ishmael1985 commented 6 years ago

Make sure you refer to this - https://wiki.archlinux.org/index.php/multihead In case it doesn't work, the only option you have left is to manually create an X11 window which can be used as a handle by mfxsink in a GStreamer application program.

skyline220 commented 6 years ago

Hi Ishmael,

Unfortunately after testing today only one Display :0 is returned - therefore I cannot bind to the second display name using mfxsinkelement. I tried disabling Xinerama (which is supposed to extend the desktop) in the Xorg.conf file in /etc/X11/ in the server options but it only created a whole lot more issues with booting the board. I will probably have to re-install Ubuntu to fix those. I was wondering if you could suggest how to make an X11 window? Do you have any other possible suggestions by specifying the starting point of the second monitor since both monitors are being treated like one big screen?

Thanks

ishmael1985 commented 6 years ago

@skyline220 can't help you much in this case, and I know of no GStreamer sink plugin that incorporates such a feature to position on a secondary display. This is the best guide I can provide to help you in application programming - https://gstreamer.freedesktop.org/documentation/tutorials/basic/toolkit-integration.html

There are a lot of X11 tutorials out there as well, here's a quick returned which is returned by Google search - http://math.msu.su/~vvb/2course/Borisenko/CppProjects/GWindow/xintro.html

skyline220 commented 6 years ago

Hi Ishmael,

I appreciate the help but before I spend a lot of time on creating X11 Window doesn't the mfxsinkelement require a seperate display identifier? For example 0:0 vs 0:1? From what I am seeing the X11 tutorials don't allow you to create a separate display or screen, merely a window within a screen which is then bound to a specific display or screen at a specific point. Is this logic correct or am I missing something?

Thanks

ishmael1985 commented 6 years ago

@skyline220 honestly this issue is more desktop environment-related than this is to the plugins, and you should really check the development API for your particular desktop (Gnome). A proposed solution would be to use the GL interoperability feature of gst-mfx and then project the GL texture to a specified display and coordinates - https://stackoverflow.com/questions/20662964/opening-an-x11-window-for-gl-on-a-specific-display

Aside from checking the Xorg configuration, nothing I can really help you much as this is out of scope of the plugin development. It doesn't make sense for us to add such a desktop specific feature in gst-mfx, and so do all other GStreamer sink plugins that I know of. In fact, the fullscreen option was simply added just for validation purposes, and we don't want to un-necessarily spoil the codebase for new features that work only for specific scenarios, unless you are a paying customer.

skyline220 commented 6 years ago

Hi Ishmael,

Thanks for the link, I have been trying to get Zaphod mode to work on this Maker Board to enable the mfxsinkelement solution you suggested. Also I thought Ubuntu 16.04 was Unity not Gnome?

Could you elaborate on the paying customer part of your post? I thought you worked at Intel and the gstreamer media sdk by Intel was to help push companies to use Intel chips for use as an embedded solution. In what other way can one be a paying customer?

ishmael1985 commented 6 years ago

@skyline220 ah, I thought you were using Debian. This repo is primarily meant for Intel customers, and for new features to be prioritized for development, you'll have to be one of those customers. Like for e.g. https://github.com/intel/gstreamer-media-SDK/issues/125 I left Intel, and I maintain gst-mfx in my spare time, having diverged from the codebase to suit broad market needs - https://github.com/ishmael1985/gstreamer-media-SDK That's all I can say for now, so if you think all your questions have been answered, please close this issue, since this isn't really an issue with the plugins imho.

skyline220 commented 6 years ago

Okay thanks for your help, I am closing this issue.