Hello,
To get screenshot, i installed fbgrab and tried with this command < fbgrab -d /dev/fb1 screen.png > . It only gives me an yellow image with few red green dots. But not the camera image.
To get the raw image and serve it over HTTP I used the following code.
borrowed most parts from :
https://lauri.xn--vsandi-pxa.com/hdl/zynq/xilinx-video-capture.html-----------------------------------------------------------------------------------
import os, png, mmap
from http.server import BaseHTTPRequestHandler, HTTPServer
import ssl
import time
FRAMEBUFFER_OFFSET=0x1F700000
WIDTH = 1280
HEIGHT = 720
PIXEL_SIZE = 4
fh = os.open("/dev/mem", os.O_SYNC | os.O_RDONLY) # Disable cache, read-only
mm = mmap.mmap(fh, WIDTH*HEIGHT*PIXEL_SIZE, mmap.MAP_SHARED, mmap.PROT_READ, offset=FRAMEBUFFER_OFFSET)
class MyHandler(BaseHTTPRequestHandler):
def do_GET(s):
writer = png.Writer(WIDTH, HEIGHT, alpha=True)
s.send_response(200)
s.send_header("Content-type", "image/png")
s.end_headers()
writer.write_array(s.wfile,mm[0:WIDTH*HEIGHT*PIXEL_SIZE] )
httpd = HTTPServer(("0.0.0.0", 8910), MyHandler)
try:
httpd.serve_forever()
except KeyboardInterrupt:
pass
httpd.server_close()
mm.close()
fh.close()
---------------------------------
But I am getting empty frames on that framebuffer offset. I think I am missing something obvious. Do I need to enable camera separately? Is it possible to share the resource file to read the camera image frame buffers.
Thank you