Aardappeltaart
Posts: 132
Joined: Wed Mar 02, 2016 11:32 am

Chromium-browser not creating screenshot

Fri Jul 12, 2019 10:02 am

I'm trying out the chromium-browser on a headless RPI4 Raspbian Lite:

Code: Select all

chromium-browser --version
Chromium 74.0.3729.157 Built on Raspbian , running on Raspbian 10

I'm not able to create a screenshot running headless:

Code: Select all

chromium-browser  --window-size=1280,1024 --screenshot --headless https://raspberrypi.org

No screenshot.png created.

Is --screenshot not supported on the pi, or do I need extra packages?

User avatar
DougieLawson
Posts: 39815
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Chromium-browser not creating screenshot

Sun Jul 14, 2019 6:40 pm

Forget that --screenshot parm. Install scrot and us that to capture what you need.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

klricks
Posts: 7236
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Chromium-browser not creating screenshot

Mon Jul 15, 2019 12:42 pm

DougieLawson wrote:
Sun Jul 14, 2019 6:40 pm
Forget that --screenshot parm. Install scrot and us that to capture what you need.
scrot is already installed by default and linked to [Print Screen] key.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Aardappeltaart
Posts: 132
Joined: Wed Mar 02, 2016 11:32 am

Re: Chromium-browser not creating screenshot

Mon Jul 15, 2019 4:20 pm

Thx, but can you run scrot on a headless Pi?

--screenshot --headless is for running chromium on servers, and create screenshots for automated testing, so without X11

Quite nice actually.

Should file a bug report then, but where?

(BTW also selenium could not create screenshot)

User avatar
DougieLawson
Posts: 39815
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Chromium-browser not creating screenshot

Mon Jul 15, 2019 6:13 pm

If you run the RealVNC server you can run scrot with

DISPLAY=:0 scrot ...

from a command line.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Aardappeltaart
Posts: 132
Joined: Wed Mar 02, 2016 11:32 am

Re: Chromium-browser not creating screenshot

Mon Jul 15, 2019 7:43 pm

yeah, but

Code: Select all

giblib error: Can't open X display. It *is* running, yeah?
And not using realvnc

AFAIK Chromium-browser can be installed on all debian/ubuntu based server installs (x64 & arm) to run headless/

Just tried it on Ubuntu Server on x64 and ARM, so why can't it be done on the Pi?

User avatar
DougieLawson
Posts: 39815
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Chromium-browser not creating screenshot

Mon Jul 15, 2019 8:02 pm

Probably because the code is broken. Get you coding pencil, your pencil sharpener and a coding pad. The source code is available.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

Aardappeltaart
Posts: 132
Joined: Wed Mar 02, 2016 11:32 am

Re: Chromium-browser not creating screenshot

Tue Jul 16, 2019 10:19 am

DougieLawson wrote:
Mon Jul 15, 2019 8:02 pm
Probably because the code is broken. Get you coding pencil, your pencil sharpener and a coding pad. The source code is available.
Thanks for the advice,

IMHO a bug report is the better option here.

Anybody knows the appropriate place for that, could be related to the special RPI fixes (GPU accelerated)

This seems obsolete:
https://github.com/raspberrypi-ui/chromium_patches

ShiftPlusOne
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6237
Joined: Fri Jul 29, 2011 5:36 pm
Location: The unfashionable end of the western spiral arm of the Galaxy

Re: Chromium-browser not creating screenshot

Tue Jul 16, 2019 10:29 am


Aardappeltaart
Posts: 132
Joined: Wed Mar 02, 2016 11:32 am

Re: Chromium-browser not creating screenshot

Fri Jan 17, 2020 4:29 pm

Yes, it's working now.

Code: Select all

sudo apt full-upgrade
chromium-browser --version
 --disable-quic --enable-tcp-fast-open --ppapi-flash-path=/usr/lib/chromium-browser/libpepflashplayer.so --ppapi-flash-args=enable_stagevideo_auto=0 --ppapi-flash-version=
Chromium 78.0.3904.108 Built on Raspbian , running on Raspbian 10
This ssh command now saves a nice screenshot.png in home:

Code: Select all

ssh pi4 chromium-browser  --window-size=1280,1024 --screenshot --headless https://raspberrypi.org
Thx all.

Return to “Troubleshooting”