A
A
Andrey Larin2021-03-09 21:58:15
linux
Andrey Larin, 2021-03-09 21:58:15

How to take screenshots in linux at intervals?

Friends, I ask for help. The question is simple, but I'll have to poke around for a couple of days.

Task: I need to take screenshots of the process of working on a 3D model in the blender program. Approximately in this way:
I go to the console, type "screencast-start" and I have the contents of the screen recorded in * .png once a minute in a certain folder.

When it is required to stop, I write another command, for example "screencast-stop". I know how to make aliases, it's not a problem to prescribe the paths, I'll figure it out.

Wang that this can be solved using the usual imagemagick + cron, but I have never worked with them, and it will take a long time to figure it out, because I'm not a programmer, but a designer.

It is very important for me to be able to tell this program to shoot the first monitor, I have two of them. And the ability to set the time between "snapshots", because. I'm not sure yet whether a minute is enough, you may have to choose a different interval.

I really hope for your help. Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
brar, 2021-03-09
@engine9

ffmpeg -thread_queue_size 512 -video_size 1920x1080 -framerate 30 -f x11grab -i :0.0 /home/username/screencasts/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).mp4

ffmpeg and x11grab respectively must be installed on the system. framerate can be done and 60 (this is fps). Screencast resolution too. Stop ctrl+c.
Of course, you can add this to the crontab and customize shortcuts / hotkeys for your DM to stop recording. But it is fraught with forgetting that recording is running, not killing the process, and it will fill up all the free space on the disk, with all the consequences (up to a file on reboot, if / home is on the same logical disk with the OS, for example).
Sorry, only then I read more carefully that we need screenshots, not vidos.
Then towards maim.
In i3wm I did it like this:
bindsym --release Print exec --no-startup-id "maim -s -c 1,0,0,0.6 ~/Screenshots/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png"

This will take a picture of the entire monitor.
In this way, you will be prompted to select an area for a screenshot:
bindsym --release $mod+Print exec --no-startup-id "maim -i $(xdotool getactivewindow) ~/Screenshots/$(date +%Hh_%Mm_%Ss_%d_%B_%Y).png"

Well, the launch interval of the above maim constructs should be inserted through "crontab -e".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question