{"id":18289569,"url":"https://github.com/yjdwbj/rp2040-uvc","last_synced_at":"2025-06-14T10:33:11.234Z","repository":{"id":215797022,"uuid":"739798576","full_name":"yjdwbj/rp2040-uvc","owner":"yjdwbj","description":"Capture video on your [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/) with a [tinyUSB](https://github.com/hathach/tinyusb) library. ","archived":false,"fork":false,"pushed_at":"2024-07-03T06:40:53.000Z","size":14207,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T09:43:10.244Z","etag":null,"topics":["freertos","ov2640","pico-sdk","rgb565","rp2040","tinyusb","uvc-camera","yuv420"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yjdwbj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-06T15:24:37.000Z","updated_at":"2025-02-21T07:39:51.000Z","dependencies_parsed_at":"2024-12-22T22:53:08.358Z","dependency_job_id":null,"html_url":"https://github.com/yjdwbj/rp2040-uvc","commit_stats":null,"previous_names":["yjdwbj/rp2040-uvc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yjdwbj/rp2040-uvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjdwbj%2Frp2040-uvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjdwbj%2Frp2040-uvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjdwbj%2Frp2040-uvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjdwbj%2Frp2040-uvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yjdwbj","download_url":"https://codeload.github.com/yjdwbj/rp2040-uvc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yjdwbj%2Frp2040-uvc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259802072,"owners_count":22913563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["freertos","ov2640","pico-sdk","rgb565","rp2040","tinyusb","uvc-camera","yuv420"],"created_at":"2024-11-05T14:07:07.690Z","updated_at":"2025-06-14T10:33:11.194Z","avatar_url":"https://github.com/yjdwbj.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# USB video class(UVC) for Pico\n\nCapture video on your [Raspberry Pi Pico](https://www.raspberrypi.com/products/raspberry-pi-pico/) with a [tinyUSB](https://github.com/hathach/tinyusb) library.\n\n## Hardware\n* RP2040 board\n* [Raspberry Pi Pico](https://www.raspberrypi.org/products/raspberry-pi-pico/)\n* ov2640 camera module within 24Mhz osc\n* ILI9341 2.8 TFT SPI 240x320 V1.2 LCD module\n\n![ov2640 front](images/cam_front.jpg)\n![ov2640 back](images/cam_back.jpg)\n![ov2640 connected_cam](images/connected_cam.jpg)\n![uvc](images/uvc.jpg)\n\n## Build\n\n```sh\n~$ git clone  https://github.com/yjdwbj/rp2040-uvc\n~$ cd rp2040-uvc\n~$ git submodule update --init\n~$ mkdir build\n~$ cd build; cmake -DUSE_FREERTOS=1 ../ \u0026\u0026 make\n```\n\n## Tips\n\n* `cmake -DUSE_FREERTOS=1` will enable `FreeRTOS` support which is recommand, otherwise use `main loop` instead.\n* If you set the OV2640 pixel format to `RGB565`, write the frame buffer directly to `LCD` and convert `rgb565 -\u003e yuv422` to `UVC` stream.\n* If you set the OV2640 pixel format to `YUV422`, write the frame buffer directly to `UVC` and convert `yuv422 -\u003e rgb565` to `LCD`. But there is a serious bug here, green/inverted block areas are very frequent.\n\n## Demo run\n![gif](images/running_uvc.gif)\n\n### Default Pinout\n\n| RP2040 | OV2640 | ILI9341 |\n|:------:|:------:|:-------:|\n|  VCC   |   3v3  |   3v3   |\n|  GND   |   GND  |   GND   |\n|  5     |  SIOC  |         |\n|  4     |  SIOD  |         |\n|  2     |  REST  |         |\n|  3     | VSYNC  |         |\n|  6     |   D0   |         |\n|  7     |   D1   |         |\n|  8     |   D2   |         |\n|  9     |   D3   |         |\n|  10    |   D4   |         |\n|  11    |   D5   |         |\n|  12    |   D6   |         |\n|  13    |   D7   |         |\n|  15    |  HSYNC |         |\n|  18    |        |  RESET  |\n|  19    |        |  RS/DC  |\n|  20    |        |  CLK    |\n|  21    |        |  MOSI   |\n|  VCC   |        |   LED   |\n|  GND   |        |   CS    |\n\n\n## V42l-ctrl examples\n\n* query the capture formats the video device supports\n\n```sh\nv4l2-ctl -d 0 --list-formats-ext\nioctl: VIDIOC_ENUM_FMT\n        Type: Video Capture\n\n        [0]: 'YUYV' (YUYV 4:2:2)\n                Size: Discrete 320x240\n                        Interval: Stepwise 0.040s - 1.000s with step 0.040s (1.000-25.000 fps)\n```\n\n* capture raw video stream from by v4l2-ctl.\n```sh\nv4l2-ctl --device /dev/video0\n--set-fmt-video=width=320,height=240,pixelformat=YUYV --stream-mmap\n--stream-to=frame.raw --stream-count=1\n```\n\n* converted into JPEG format by ffmpeg.\n```sh\nffmpeg -y -s:v 320x240 -pix_fmt yuyv422 -i frame.raw frame.jpg\n```\n\n## FFmpeg examples\n\n* play video from uvc device on linux.\n```sh\nffplay  -f v4l2 -framerate 25  -video_size 320x240  -i /dev/video0\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjdwbj%2Frp2040-uvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyjdwbj%2Frp2040-uvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyjdwbj%2Frp2040-uvc/lists"}