57

I have a laptop with a built-in screen and an attached monitor.

When I start a Google's video Hangout and share my desktop, I would like to be able to share only the attached screen, but I don't know how.

Right now I have two monitors: LVDS1 corresponds to my laptop's screen, which is configured as the secondary screen and DP1 which is my primary screen. But the problem still remains if I change my laptop's screen to be the primary screen.

$ xrandr
Screen 0: minimum 320 x 200, current 3286 x 1468, maximum 8192 x 8192
LVDS1 connected 1366x768+1920+700 (normal left inverted right x axis y axis) 344mm x 194mm
   1366x768      60.06*+
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
VGA1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 475mm x 267mm
   1920x1080     60.00*+
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.08    60.00  
   800x600       75.00    60.32  
   640x480       75.00    60.00  
   720x400       70.08  

Whenever I start sharing my desktop in the Hangout, only the built-in (smaller) screen is shared. Best thing would be to be able to chose which one to share, but if not, how could I share only the attached (bigger) screen?

I bet Google's Hangout is looking for a configuration file to choose which screen to share, but don't know which file it is.

NOTE

Using Fedora 20, x86_64, Linux 3.15.10-200, GNOME Shell 3.10.4-8, Firefox 31.

NOTE 2

Using Google Chrome makes Google Hangouts share both screens at the same time instead of only the laptop's screen, which I think is even worse. Still trying to find out how could I choose which screen to share.

8
  • As an experiment if you make your secondary screen your primary via GNOME settings dialog does hangouts get opened on the secondary monitor?
    – slm
    Commented Aug 28, 2014 at 1:07
  • @slm: It seems that is always taking my laptop's screen for sharing. No matters if it is the primary or the secondary sreen.
    – Peque
    Commented Aug 29, 2014 at 7:05
  • I've been battling with my own issues with Chrome, Cinnamon, and multiple monitors too. It's extremely annoying. I'll try and keep digging.
    – slm
    Commented Aug 29, 2014 at 12:12
  • I'm facing the same problem, using chrome on Linux Mint 15 the hangouts screen share shows both my monitors. Really annoying
    – user83688
    Commented Sep 10, 2014 at 13:15
  • 1
    I don't know how you get a single monitor, I have never seen that. But as for both monitors at the same time, I suspect that Chromium only shares an X "screen". XRandR makes both monitors appear on one X screen, so until someone at Google fixes that I doubt there is a workaround without using something else like Xinerama.
    – Jarryd
    Commented Mar 31, 2016 at 0:26

5 Answers 5

52

Problem

It turns out there's already an open issue in the Chromium tracker about this annoying inconvenience. Existing options offered by Hangouts have major drawbacks:

  1. Share Entire Screen: If you have multiple screens (I have three) and share "Entire Screen", other people in the hangout won't be able to see anything.

  2. Share Application: If you only share a specific application, then:

    • You will have to manually switch to other apps while streaming by going back to hangouts and switching Screen Share on/off.
    • In some applications, extra windows (such as dialogs for preferences, menus, popups, etc.) won't be captured as part of the app you're sharing. And most of the times it's these dialogs you want to focus on.

Solution / workaround

A very good workaround is at Comment 18 of this same discussion, so all the credits should go to the comment's author.

I'll summarize the process here, which allows you to Share a Part/Area of your multi-monitor screen in Google Hangouts running in a Linux Machine.

  1. Open VLC in "Screen Capture" mode and tell it which part of your X11 screen you want it to capture, using the appropriate Screen Module command-line parameters. You can either do this through GUI configuration OR using the command line:

    vlc \
        --no-video-deco \
        --no-embedded-video \
        --screen-fps=20 \
        --screen-top=32 \
        --screen-left=0 \
        --screen-width=1920 \
        --screen-height=1000 \
        screen://
    
  2. If VLC complains about not being able to open screen://, please make sure you have correct module installed. For me, on ubuntu 19.10, I had to install an additional package vlc-plugin-extra-access by invoking apt install vlc-plugin-access-extra.

  3. Go back to Google Hangouts and share the newly opened VLC window, which now acts as your "portal" to the interesting part of your screen.

Important notes

  1. Move the VLC window away from the part of the screen you are capturing to avoid inception effects.

  2. Do NOT resize OR minimize the VLC window because it will affect the resolution of your screen share. If you want to get it out of your way while streaming to hangouts, just move it off-screen WITHOUT resizing it, or just pretend it's not there.

  3. The mouse pointer is not captured by VLC in linux. The author of the workaround suggests a solution for this as well: ExtraMaus, a simple C programs which creates a "clone" of your mouse, but visible by VLC.

[TL;DR] Explaining the values I chose in the example

  1. The screen:// parameter indicates we want to enable the Screen Capture module. You'll always use this parameter as is.

  2. The flags --no-video-deco and --no-embedded-video hide the window menu and video control toolbar respectively. You don't want to share these through Hangouts, so I suggest you always include these parameters.

  3. The --screen-fps=20 does not have to be 20. You can make it 30 or 10, since performance is primarily affected by how Chrome encodes the video stream.

  4. The area of the screen you want to captured follows the standard convention [--screen-top, --screen-left, --screen-width, --screen-height]. Supposing I had two monitors, each 1920x1080, giving a total 3840x1080 "virtual" screen when placed one next to the other, I could give the following coordinates:

    1. [ 0, 0, 1920, 1080] for my entire left screen
    2. [ 0, 1920, 1920, 1080] for my entire right screen
    3. [32, 0, 1920, 1000] for a part of my left screen which spans across its full width but trims 32 pixels from its top (where I usually have a window's title bar) and 1080-1000-32 = 48 pixels from its bottom (where I have my KDE taskbar).
7
  • 1
    This is decent workaround. Easy to implement. Thanks Commented Sep 27, 2017 at 15:00
  • 2
    if face problem like : VLC is unable to open the MRL 'screen://'. Check the log for details. sudo apt-get install vlc-plugin-access-extra then use the command line from above to open your vlc
    – Leo Yu
    Commented Jun 7, 2018 at 17:53
  • 1
    I was able to use that for a long time with Debian. I'm in Ubuntu now and it doesn't seem to know the arguments: unknown option or missing mandatory argument '--screen-top=0' Commented Nov 16, 2018 at 13:17
  • 1
    I made some notes on doing this with i3 gist.github.com/kylebrandt/237368095cd9803536ac26529340a60f Commented Jan 17, 2019 at 18:07
  • 1
    We have the medicine, and you won't need workaround anymore. See the post "Updated News" below! Commented May 12, 2020 at 22:42
11

Updated News

Good news for everybody: We have the medicine, and you won't need workaround anymore. ; )

This bug was fixed in Chromium 83 Beta (dev/unstable). I have tested the version 83.0.4103.14 (Official Build) beta (64-bit) in Kubuntu 18.04. And this version fixes this issue !


Upgrade

If you want to install this version Beta, follow this steps:

  1. Download beta version by this link:

  2. Go to the folder and do this command:

    sudo apt install ./google-chrome-beta_current_*.deb

If using Arch Linux, install chromium-snapshot-bin from AUR. Confirmed working without workaround on version 85.0-1.


Stable Version

According Wikipedia (Google Chrome version history) the version 83.0.4103 was released on 16 April 2020.

Maybe it can take six weeks (forecast for major releases) until we can see it in the Stable Channel, that woud be about the end of May. Let's pray! ; )

**** UPDATE in 2020-06-04 ****

The Major version "83.0.4103" was released in Stable channel since 2020-05-19. This date is according to Wikipedia (Google Chrome version history) and may be different depending on your distro.

In my Kubuntu 18.04, the version of Chrome (stable) is "83.0.4103.97-1", tested and works fine. So, we don't need to use workaround, neither Beta version of Chrome! YES !!! \o/ \o/ \o/

5
  • This is Great !!! Commented May 18, 2020 at 8:20
  • Yes! And a lot of people have been making workaround solutions unnecessarily. Commented May 18, 2020 at 17:30
  • 1
    The Beta version of chrome works fine for sharing screen on Hangout but normal loading of pages does not work properly. So I had to keep both the versions, Beta version only when I need to share screen, Commented May 19, 2020 at 6:23
  • Yes Shubham, this the way I do it too. Keep both Beta and the Stable, and use beta only to share screen. Commented May 19, 2020 at 16:22
  • good news for chromium users! Still, for firefox it is impossible to share individual screen. Also, I saw a similar problem in discord app. So the workaround still needed in some cases.
    – Ashark
    Commented May 23, 2020 at 20:17
10

I think I have found a better workaround than using vlc. We just need to create a fake webcam that shows our screen.

# Unload
sudo rmmod v4l2loopback
# Load module
sudo modprobe v4l2loopback video_nr=7 'card_label=myFakeCam' 'exclusive_caps=1'

ffmpeg -f x11grab -r 20 -s 1920x1080 -i :0.0+0,0 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video7

Then we need to make it appear in chromium in list of available cameras. We can make it for example by deactivating and then activating internal laptop webcam. First you should find out its usb bus and port number. In my case: Bus is 01 and Port is 4, so I run:

sudo sh -c "echo '0'> /sys/bus/usb/devices/1-4/bConfigurationValue"
sudo sh -c "echo '1'> /sys/bus/usb/devices/1-4/bConfigurationValue"

After that I am able to choose myFakeCam in Hangouts.

I have described some other ideas and some more details in hliss repo.

Google Chrome can't see fake camera

0

Modified version of the script in hliss repo to be able to select the area of a window or draw the area with a rectangle.

https://gist.github.com/adrianlzt/216aabb9568b162c92317f768d889c76

-2

Load xrdp on your laptop. Start an rdesktop connection to localhost. Use the rdesktop session to initiate the google+ session, and only that window/desktop will be shared.

I realize this is more of a work-around, but it will get done what you are looking to do.

1
  • Funny :-). But yes, that is not really a solution (not even a work-around). I would rather simply turn off the laptop screen before starting the hangout, which is faster and cleaner... ;-) One usually wants to share what they have already opened in their desktops (what they are currently working on).
    – Peque
    Commented Dec 9, 2015 at 11:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .