36

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.

  • As an experiment if you make your secondary screen your primary via GNOME settings dialog does hangouts get opened on the secondary monitor? – slm Aug 28 '14 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 Aug 29 '14 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 Aug 29 '14 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 Sep 10 '14 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 Mar 31 '16 at 0:26
28

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. 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).
  • 1
    This is decent workaround. Easy to implement. Thanks – Pierre de LESPINAY Sep 27 '17 at 15:00
  • 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 Jun 7 '18 at 17:53
  • 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' – Pierre de LESPINAY Nov 16 '18 at 13:17
  • 1
    I made some notes on doing this with i3 gist.github.com/kylebrandt/237368095cd9803536ac26529340a60f – Kyle Brandt Jan 17 at 18:07
5

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.

  • 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 Dec 9 '15 at 11:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.