README.rst
1.. zephyr:code-sample:: video-capture-to-lvgl
2 :name: Video capture to LVGL
3 :relevant-api: video_interface
4
5 Capture video frames and display them on an LCD using LVGL.
6
7Description
8***********
9
10The application uses the :ref:`Video API <video_api>` to retrieve video frames from
11a video capture device, write a frame count message to the console, and then send
12the frame to an LCD display.
13
14Requirements
15************
16
17This sample requires a supported :ref:`video capture device <video_api>` (e.g., a camera)
18and a :ref:`display <display_api>`.
19
20Wiring
21******
22
23On the `WeAct Studio STM32H743`_, connect the OV2640 camera module and the 0.96" ST7735
24TFT LCD display. Connect a USB cable from a host to the micro USB-C connector on the
25board to receive console output messages.
26
27Building and Running
28********************
29
30For :zephyr:board:`mini_stm32h743`, build this sample application with the following commands:
31
32.. zephyr-app-commands::
33 :zephyr-app: samples/drivers/video/capture_to_lvgl/
34 :board: mini_stm32h743
35 :shield: weact_ov2640_cam_module
36 :goals: build flash
37 :gen-args: -DCONFIG_BOOT_DELAY=2000
38 :compact:
39
40For testing purpose and without the need of any real video capture hardware,
41a video software pattern generator is supported by using :ref:`snippet-video-sw-generator`:
42
43.. zephyr-app-commands::
44 :zephyr-app: samples/drivers/video/capture
45 :board: native_sim/native/64
46 :snippets: video-sw-generator
47 :goals: build
48 :compact:
49
50Sample Output
51=============
52
53.. code-block:: console
54
55 [00:00:02.779,000] <inf> main: - Device name: dcmi@48020000
56 [00:00:02.779,000] <inf> main: - Capabilities:
57 [00:00:02.779,000] <inf> main: RGBP width [160; 160; 0] height [120; 120; 0]
58 [00:00:02.779,000] <inf> main: RGBP width [176; 176; 0] height [144; 144; 0]
59 [00:00:02.780,000] <inf> main: RGBP width [240; 240; 0] height [160; 160; 0]
60 [00:00:02.780,000] <inf> main: RGBP width [320; 320; 0] height [240; 240; 0]
61 [00:00:02.780,000] <inf> main: RGBP width [352; 352; 0] height [288; 288; 0]
62 [00:00:02.780,000] <inf> main: RGBP width [640; 640; 0] height [480; 480; 0]
63 [00:00:02.780,000] <inf> main: RGBP width [800; 800; 0] height [600; 600; 0]
64 [00:00:02.780,000] <inf> main: RGBP width [1024; 1024; 0] height [768; 768; 0]
65 [00:00:02.780,000] <inf> main: RGBP width [1280; 1280; 0] height [1024; 1024; 0]
66 [00:00:02.780,000] <inf> main: RGBP width [1600; 1600; 0] height [1200; 1200; 0]
67 [00:00:02.780,000] <inf> main: JPEG width [160; 160; 0] height [120; 120; 0]
68 [00:00:02.780,000] <inf> main: JPEG width [176; 176; 0] height [144; 144; 0]
69 [00:00:02.780,000] <inf> main: JPEG width [240; 240; 0] height [160; 160; 0]
70 [00:00:02.780,000] <inf> main: JPEG width [320; 320; 0] height [240; 240; 0]
71 [00:00:02.780,000] <inf> main: JPEG width [352; 352; 0] height [288; 288; 0]
72 [00:00:02.780,000] <inf> main: JPEG width [640; 640; 0] height [480; 480; 0]
73 [00:00:02.780,000] <inf> main: JPEG width [800; 800; 0] height [600; 600; 0]
74 [00:00:02.780,000] <inf> main: JPEG width [1024; 1024; 0] height [768; 768; 0]
75 [00:00:02.780,000] <inf> main: JPEG width [1280; 1280; 0] height [1024; 1024; 0]
76 [00:00:02.780,000] <inf> main: JPEG width [1600; 1600; 0] height [1200; 1200; 0]
77 [00:00:02.852,000] <inf> main: - Format: RGBP 160x120 320
78 [00:00:02.854,000] <inf> main: - Capture started
79
80References
81**********
82
83.. target-notes::
84
85.. _WeAct Studio STM32H743: https://github.com/WeActStudio/MiniSTM32H7xx
86