diff --git a/examples/vision/streaming/rtsp_and_display.py b/examples/vision/streaming/rtsp_and_display.py new file mode 100644 index 00000000..b4375b3b --- /dev/null +++ b/examples/vision/streaming/rtsp_and_display.py @@ -0,0 +1,26 @@ +from maix import app, rtsp, camera, image, display + +# init camera +cam = camera.Camera(2560, 1440, image.Format.FMT_YVU420SP) +cam2 = cam.add_channel(640, 480) + +# init display +disp = display.Display() + +# init rtsp server +server = rtsp.Rtsp() +server.bind_camera(cam) +server.start() + +# draw region +rgn = server.add_region(0, 0, 200, 100) +canvas = rgn.get_canvas() +canvas.draw_string(0, 0, "Hello MaixPy") +rgn.update_canvas() + +print(server.get_url()) +while not app.need_exit(): + img = cam2.read() + disp.show(img) + +server.stop() \ No newline at end of file diff --git a/maix/v1/sensor.py b/maix/v1/sensor.py index 62a3d5d5..c86feaad 100644 --- a/maix/v1/sensor.py +++ b/maix/v1/sensor.py @@ -142,21 +142,21 @@ def get_id(): raise ValueError('This operation is not supported') def set_hmirror(enable): - __camera.set_vflip(enable) + __camera.hmirror(enable) def set_vflip(enable): - __camera.set_vflip(enable) + __camera.vflip(enable) def set_brightness(brightness): brightness = brightness + 3 val = brightness * 100 / 4 - __camera.set_luma(int(val)) + __camera.luma(int(val)) def set_contrast(contrast): - __camera.set_constrast(contrast) + __camera.constrast(contrast) def set_saturation(saturation): - __camera.set_saturation(saturation) + __camera.saturation(saturation) def width(): return __camera.width()