tvjon
Posts: 706
Joined: Mon Jan 07, 2013 9:11 am

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 5:44 pm

"AndyD updated the program today and now emits an error instead of an empty image."

I don't think his new version is the problem, as I've just built it, replaced my old version & it produces the same picture as I posted earlier.

Without a monitor plugged in, I get the same:

state 0x40001 [NTSC 4:3], 720x480 @ 60.00Hz, interlaced.


OS version, config.txt relevant contents?

DirkS
Posts: 9871
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 8:05 pm

tvjon wrote:I don't think his new version is the problem,
And that's not what I said.
What I said was that after the update I get an error msg instead of a blank png...

I already found out what causes the problem: not enough memory allocated to the GPU.
I use gpu_mem=16 on my Zero with Jessie Lite. I temporarily set it to 92 and it worked.
It would probably work with a lower setting.

BTW: if you quote text can you please use the 'quote' button so that it is clear *that* you are quoting and *who* you are quoting.
Just a pair of double quotes makes it pretty much impossible to follow...

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 8:39 pm

tvjon wrote:"Should I be able to take a snapshot of a terminal window. I have tried and all I get is a black rectangle."

Can you elaborate MrEngman?
I have a Pi 1 with 512MB ram. I have no screen connected. Just wifi and a USB card reader connected. I am communicating with my Pi using SSH via wifi.

Cloned the rasp2png repo and compiled it. I am running rasp2png from the directory where rasp2png source is saved. Just tried git pull to update the source and it says it is up to date. All I see is this
snapshot.png
snapshot.png (1.06 KiB) Viewed 1281 times
my screen actually looks like this
screen4.png
screen4.png (62.46 KiB) Viewed 1281 times
EDIT: just tried with a Pi 2 B and get the same results. and copied the wrong file. With the Pi 2 B, using the same SD card I tried with the Pi 1 512MB, I see a screen with 4 raspberry icons. Not what I wanted though, oh well. I had hoped to get a copy of the screen I see using SSH.



MrEngman
Last edited by MrEngman on Thu Jan 21, 2016 8:59 pm, edited 1 time in total.
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

DirkS
Posts: 9871
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 8:52 pm

MrEngman wrote:
tvjon wrote:"Should I be able to take a snapshot of a terminal window. I have tried and all I get is a black rectangle."

Can you elaborate MrEngman?
I have a Pi 1 with 512MB ram. I have no screen connected. Just wifi and a USB card reader connected. I am communicating with my Pi using SSH via wifi.
MrEngman
See my post above re GPU memory setting.
For me it did not work with gpu_mem=16 in /boot/config.txt

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:03 pm

DirkS wrote:
MrEngman wrote:
tvjon wrote:"Should I be able to take a snapshot of a terminal window. I have tried and all I get is a black rectangle."

Can you elaborate MrEngman?
I have a Pi 1 with 512MB ram. I have no screen connected. Just wifi and a USB card reader connected. I am communicating with my Pi using SSH via wifi.
MrEngman
See my post above re GPU memory setting.
For me it did not work with gpu_mem=16 in /boot/config.txt
I don't have a setting for gpu_mem in /boot/config.txt so I expect it is using the default whatever that is which I would think should be OK. But sort of works on a Pi 2 B but not on my Pi 1 512MB. See edit in previous post.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:30 pm

MrEngman wrote:Not what I wanted though, oh well. I had hoped to get a copy of the screen I see using SSH.
Sorry MrEngman, I had misunderstood your original question.

If you want to get a screen shot of your SSH screen, you will need to take a screen shot on the computer that you using to connect to the Raspberry Pi.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:35 pm

DirkS wrote:...
I already found out what causes the problem: not enough memory allocated to the GPU.
I use gpu_mem=16 on my Zero with Jessie Lite. I temporarily set it to 92 and it worked.
It would probably work with a lower setting.
Thanks, I wonder if it is worth adding to the error message when the display doesn't open. The message itself is probably meaningless to most people.

So far the two reasons that the open will fail is if the display is turned off or if there isn't sufficient GPU memory.

What are your thoughts @tvjon and @Dirks?

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:36 pm

AndyD wrote:
MrEngman wrote:Not what I wanted though, oh well. I had hoped to get a copy of the screen I see using SSH.
Sorry MrEngman, I had misunderstood your original question.

If you want to get a screen shot of your SSH screen, you will need to take a screen shot on the computer that you using to connect to the Raspberry Pi.
True, the only problem is that the file size is then to big to post on the forum. I have to reduce my screen size to about 80*24 when I normally use 180*50 :(

All the same a useful program if you're using a screen in text mode.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
AndyD
Posts: 2331
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:45 pm

MrEngman wrote:True, the only problem is that the file size is then to big to post on the forum. I have to reduce my screen size to about 80*24 when I normally use 180*50 :(
If you are saving your screen shots as PNG files, there is a useful program that will optimize the size of the file to its smallest. It is called pngcrush. I use it all the time when I want to post PNG files. It is available in the Raspbian repository and you can download Windows executables as well.

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Take screenshots/video's without X server?

Thu Jan 21, 2016 9:48 pm

AndyD wrote:
MrEngman wrote:True, the only problem is that the file size is then to big to post on the forum. I have to reduce my screen size to about 80*24 when I normally use 180*50 :(
If you are saving your screen shots as PNG files, there is a useful program that will optimize the size of the file to its smallest. It is called pngcrush. I use it all the time when I want to post PNG files. It is available in the Raspbian repository and you can download Windows executables as well.
That sounds useful. Thanks for the pointer.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

diracsbracket
Posts: 13
Joined: Thu Jun 25, 2015 3:07 pm

Re: Take screenshots/video's without X server?

Thu May 26, 2016 5:50 pm

This is great! Thanks for providing this!

User avatar
ab1jx
Posts: 867
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Take screenshots/video's without X server?

Fri Dec 29, 2017 6:47 pm

Does fbgrab work? I think omxplayer uses a framebuffer. If you use it under X with a pager active it's in the same place on every desktop, like it's happening at a lower level than X.

Return to “General discussion”