Is it possible to read somehow VGA port of graphics card by Arduino? Even with some minimal 320 x 240 resolution and minimal frame rate per second, to convert pixels into numbers (for example) somehow. Who can show where to dig?
2 Answers
Calculation:
320 x 240 resolution (assuming 8 bits for 256 colors) is 76,800 bytes
Assuming a frame rate of 50, that is 50 * 76,800 = 3,840,000 bytes/s
The most Arduino's are 16 MHz so assuming quite some instructions are needed (for converting and doing something) I doubt you will get this frame rate.
Also, you cannot store a complete page, but this may not be necessary.
Your standard VGA (640x480@60Hz) has a 25.175MHz pixel clock. That's far too high for an Arduino to read as an analog signal. It's even to high to read as a digital signal through a comparator (1-bit monochrome). Added to that you have three signals, red, green and blue, you would want to sample the signal at 75.525Msps if done sequentially, or 25.175Msps if done with three ADCs in parallel.
Now the Arduino has no hope of ever doing that. However there are methods that could be useful - methods that allowed a lowly little 8-bit computer, such as the ZX Spectrum, etc, to capture graphics when running at only a couple of MHz (such as the Videoface).
One of the most interesting in this scenario is called progressive scan (not to be confused with the "progressive scan" used in HD terminology to mean the opposite of interlaced). With this you don't try and capture an entire frame in one go. Instead you capture just a few pixels from each scan line (and even only from a selection of scan lines) from each frame. In subsequent frames you capture a different selection of pixels. Over a number of frames (which can be quite a large number given the amount of data you'd need to capture) you will get the entire image. Of course this is no use if the image is rapidly changing since the image data that you would be reading would change part way through constructing your final image resulting in interesting banding effects.
About half way through this video you can see the scanning in action and how motion causes banding.
So yes, technically it is possible to capture VGA on an Arduino (maybe with the addition of extra external memory) however it is very hard to do it and the results may not be anywhere like what you actually want.
-
actually i want to convert black and white video somehow to view it on led panel with 64x128 leds for example. I want to create something like this youtube.com/watch?v=abPNrJshMns Commented Oct 8, 2017 at 21:07