simple way to record video for a single pixel on the screen? - screenshot

I'd like to analyze streaming video of a process that's periodic but changes slowly over the course of hours. Is there a simple way in Mac OS X 10.7 to directly record what's happening at a single pixel over time?
(By "simple" I mean without doing a conventional screen record, splitting the video into frames, and taking pixel data from each frame.)

You could accomplish this by utilizing the screencapture command in OS X. Using the -Rx,y,w,h parameter, you can specify a section of the screen. Used in a bash script, you can save incremental screencapture images in a infinite loop.
For example, the following script will capture the pixel at X:100, Y:200 and save it as screenshot_#.png once every second.
#!/bin/bash
counter=1
while true; do
#Create output file name.
output="screenshot_$counter.png"
echo "Capturing: $output"
#Screen capture a section of the screen x,y,w,h.
screencapture -R100,200,1,1 "$output"
#Increment counter.
counter=$(($counter + 1))
#Number of second to wait between taking screenshots.
sleep 1
done
To stop it from running, just hit Ctrl + C.
UPDATE:
Unfortunately, the -R argument is new in either OS X 10.8 or 10.9. It is not available in 10.7 and below.

Related

Jitbit Macro Recorder - IF Image statement, why it is not waiting until the image appears?

I am using Jitbit MacroRecorder and it is a really helpful tool. The problem is this: By using the IF image found feature, I want the program to execute 2 sequential commands as soon as the image I selected on my screen appears. However, the program is putting too much load on the CPU by running thousands of times until the IF statement is true. What I want is for the program to WAIT until the image in the IF image found statement appears on the screen, that is, not to run thousands of times.
My simple code
The only way for the program to know when the image appears is to continuously "scan" the screen until it sees it. You may be able to use the image NOT found feature inside a loop with a delay. You would look for the image, and if not found, delay a second, and then look for it again. The tradeoff is you will have that delay in there which will keep your program from running the following commands immediately.

How do I delay video from my webcam on my own feed?

Id like to have the ability to delay the video from my webcam on. my own computer. Honestly I am using. it. as a "delayed mirror" for my golf swing. I have always recorded, then stopped, opened up the file and watched then did it again. Doing this 30 times in a session working on my swing is annoying. Id like to just take a webcam, be able to delay the video 5,8,10 seconds so I can watch and just keep moving. what is the easiest way around this. I have been told I could do this with a script but not sure where to start. Can anyone help me or send me in the right direction? Im on a Mac but also have a PC if needed.
Python + OpenCV.
First manage to show a current image from your webcam using tutorials.
Then instead of immediately showing the image you add it at the end of a buffer object, this could be a collections.deque from standard Python.
If you want to delay for say 5 seconds and you're capturing with 30 frames per second, then don't show anything until you add 5*30 images from your camera to the buffer. Now when you filled the buffer as soon as you get another image, you add it to the end of the buffer, but also remove 1 image from the beginning of the buffer and show it.

GNU-screen disable scrollback

How to disable scrollback (^A[ESC]) mode in screen and just have it straight up print to the terminal instead (using the builtin scroll of my terminal emulator)?
I am using screen on gnome-terminal across an ssh session
Since the terminal has builtin scroll capabilities, I just want to be able to use the scrollwheel on the mouse to scroll as opposed to using ^A[ESC]
In command mode (^A:), set scrollback 0.
A few notes:
The current length of the scrollback buffer in lines is shown (among other stuff) by the info command (after the plus character).
Using the mouse wheel will not give the same experience that screen can offer
the terminal's scrollback contains exactly data that was actually displayed
data from inactive windows is not available
split windows will show as-is
I am answering an 8 year old question that came up in a web search - the answer was in man screen.

Launch GUI program at host through SSH

I've got a Raspberry Pi connected to my TV, with no mouse or keyboard.
I'm sshing into it, starting X and then I want to launch VLC (or any other GUI program, for that matter). If I ssh -X, that will open the program in the computer I'm sshing from, not on the TV.
How can I launch a program and make it appear on the TV?
Slightly less typing than Joachim's (and actually slightly different behavior):
DISPLAY=:0 vlc
This doesn't actually set the DISPLAY variable to :0 for the whole shell session, only passes it to vlc.
So:
If you want to start other X programs in that session after VLC, Joachim's is better.
If you just want to run VLC ASAP, this is faster by 9 keypresses. :)
(I wanted to add this only as a comment, but I didn't have enough points for that, sorry.)
The DISPLAY environment variable needs to have a value set to which display the program should be opened. If you set it to :0, it means the first local screen.
This should in other words open vlc on the first local screen;
export DISPLAY=:0 ; vlc

Detach and reattach a complete Screen session with multiple windows

I am writing a client/server-application and when I'm testing the code I want to be able to have both the server and client in a separate terminal (+ vim). For this I thought I could use GNU Screen and divide the terminal in multiple windows (and it works great!). But I have a problem when I want to detach the whole session with windows and all. When I try to reattach the session I don't get them in windows like I arranged it, but instead they attaches like "normal" screen instances.
Also, is there a way to change the size of a screen window? Like change the height proportions of two windows splitted vertically.
your first question isn't possible because the regions (the way the windows are displayed) are bound to a single screen instance and not to a screen session.
C-a :
resize
see man screen for more explanation of the resize command