{"id":17602351,"url":"https://github.com/carsonfenimore/libcamlite","last_synced_at":"2026-02-09T04:37:49.325Z","repository":{"id":258274190,"uuid":"870091693","full_name":"carsonfenimore/libcamlite","owner":"carsonfenimore","description":"C++ library providing extremely efficient and asynchronous h264 and lowres RGB streams, in parallel, to aid in building security/AI platforms.","archived":false,"fork":false,"pushed_at":"2024-10-26T19:54:15.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T15:51:58.778Z","etag":null,"topics":["ai","raspberry-pi","vision"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carsonfenimore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-09T12:32:17.000Z","updated_at":"2024-10-26T19:54:18.000Z","dependencies_parsed_at":"2024-12-10T12:50:39.060Z","dependency_job_id":null,"html_url":"https://github.com/carsonfenimore/libcamlite","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":0.25,"last_synced_commit":"bf90cd9c3c96db2798ea7e6df9ad8bd8658c0b84"},"previous_names":["carsonfenimore/libcamlite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/carsonfenimore/libcamlite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Flibcamlite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Flibcamlite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Flibcamlite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Flibcamlite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carsonfenimore","download_url":"https://codeload.github.com/carsonfenimore/libcamlite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carsonfenimore%2Flibcamlite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268310786,"owners_count":24230183,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","raspberry-pi","vision"],"created_at":"2024-10-22T13:07:53.393Z","updated_at":"2026-02-09T04:37:49.320Z","avatar_url":"https://github.com/carsonfenimore.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libcamlite\nlibcamlite is a C++ wrapper for creating h264 and RGB video streams on a raspberry pi.\n\nThis is particularly useful in cv workflows, where we both want a compressed stream for viewing alongside raw RGB frames for inference. This library quickly sets up both streams at minimal cpu cost - less than 10% of cpu even on a pi zero 2W.\n\n\n## Prerequisites\nTo build this library you will need to build libcamera and rpicam-apps.  We currently are building against the following versions:\n\nrpicam-apps build: 1.9.1\nlibcamera build: v0.5.2+99-bfd68f78\n\nAlthough it is best to follow their individual guides, here's a brief summary of what it takes:\n\n### Build libcamera\nFollow the instructions under \"Getting Started\" in the libcamera git page, roughly:\n\n```\nsudo apt install -y python-pip git python3-jinja2\nsudo apt install -y libboost-dev\nsudo apt install -y libgnutls28-dev openssl libtiff-dev pybind11-dev\nsudo apt install -y qtbase5-dev libqt5core5a libqt5widgets\nsudo apt install -y meson cmake\nsudo apt install -y python3-yaml python3-ply\nsudo apt install -y libglib2.0-dev libgstreamer-plugins-base1.0-dev\ngit clone https://github.com/raspberrypi/libcamera.git\ncd libcamera\nmeson setup build --buildtype=release -Dpipelines=rpi/vc4,rpi/pisp -Dipas=rpi/vc4,rpi/pisp -Dv4l2=true -Dgstreamer=enabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=disabled -Ddocumentation=disabled -Dpycamera=enabled\nninja -C build install\n```\n\n### Build rpicam-apps\nFollow the instructions under https://www.raspberrypi.com/documentation/computers/camera_software.html#building-rpicam-apps\n\n```\nsudo apt install -y cmake libboost-program-options-dev libdrm-dev libexif-dev\nsudo apt install -y meson ninja-build\ngit clone https://github.com/raspberrypi/rpicam-apps.git\ncd rpicam-apps\nmeson setup build -Denable_libav=disabled -Denable_drm=enabled -Denable_egl=disabled -Denable_qt=disabled -Denable_opencv=disabled -Denable_tflite=disabled -Denable_hailo=disabled\nmeson compile -C build\nsudo meson install -C build\n```\n\n\n## Build\nYou can build as follows:\n\n```\n  mkdir build\n  cd build\n  cmake ..\n  make\n```\n\nOn very constrained platforms, such as the pi zero 2W, I recommend setting up a cross compiler.  Roughly the easiest way I have found to do this is:\n  - Make an ubuntu vm\n  - use sbuild/chroot to make a bullseye arm64 environment\n  - apt install all needed dependencies\n\nThis will be slower than, say, native per core - but given enough cores and ram it will allow libcamera, rpicam-apps, and libcamlite to all build in minutes rather than hours.\n\n## Demo\n\nOnce built run vid_test - this will setup simultaneous h264 and raw captures and show their capture frame rates. Output on  zero 2W is something like:\n\n```\ncarson@atomcam-2:~/libcamlite/build $ ./vid_test \n[19:32:12.714576068] [10603]  INFO Camera camera_manager.cpp:330 libcamera v0.5.2+99-bfd68f78\n[19:32:12.750937665] [10604]  INFO IPAProxy ipa_proxy.cpp:180 Using tuning file /usr/local/share/libcamera/ipa/rpi/vc4/imx290.json\n[19:32:12.754119682] [10604]  INFO Camera camera_manager.cpp:220 Adding camera '/base/soc/i2c0mux/i2c@1/imx290@1a' for pipeline handler rpi/vc4\n[19:32:12.754224718] [10604]  INFO RPI vc4.cpp:440 Registered camera /base/soc/i2c0mux/i2c@1/imx290@1a to Unicam device /dev/media3 and ISP device /dev/media0\n[19:32:12.754266348] [10604]  INFO RPI pipeline_base.cpp:1107 Using configuration file '/usr/local/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'\nMade DRM preview window\nMode selection for 1280:720:12:P(30)\n    SRGGB10_CSI2P,1280x720/60.0024 - Score: 1000\n    SRGGB10_CSI2P,1920x1080/60.0024 - Score: 1250\n    SRGGB12_CSI2P,1280x720/60.0024 - Score: 0\n    SRGGB12_CSI2P,1920x1080/60.0024 - Score: 250\nStream configuration adjusted\n[19:32:12.768190794] [10603]  INFO Camera camera.cpp:1215 configuring streams: (0) 1280x720-YUV420/Rec709 (1) 1280x720-SRGGB12_CSI2P/RAW (2) 300x300-YUV420/Rec709\n[19:32:12.768553144] [10604]  INFO RPI vc4.cpp:615 Sensor: /base/soc/i2c0mux/i2c@1/imx290@1a - Selected sensor format: 1280x720-SRGGB12_1X12/RAW - Selected unicam format: 1280x720-pRCC/RAW\nDiscovered stream; cpar 1280x720; time 1/1200000\nVidtest: lowres received 22.25 fps\nVidTest: h264 received 22.15 fps 135994 bytes/sec\nVidtest: lowres received 30.02 fps\nVidTest: h264 received 30.03 fps 247091 bytes/sec\nVidtest: lowres received 29.95 fps\nVidTest: h264 received 29.86 fps 251681 bytes/sec\nVidtest: lowres received 30.02 fps\nVidTest: h264 received 30.01 fps 252420 bytes/sec\nVidtest: lowres received 30.02 fps\nVidTest: h264 received 30.02 fps 254364 bytes/sec\nVidtest: lowres received 30.02 fps\nVidTest: h264 received 30.02 fps 254127 bytes/sec\nVidtest: lowres received 30.02 fps\nVidTest: h264 received 30.02 fps 255815 bytes/sec\n```\n\nNote this shows an excellent 30fps of both h264 (full 1920x1080 frame rate) and 300x300 lowres RGB!  This is acheived in under .08 loading (\u003c10%) of a rpi zero 2w. Very nice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonfenimore%2Flibcamlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarsonfenimore%2Flibcamlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarsonfenimore%2Flibcamlite/lists"}