{"id":20199886,"url":"https://github.com/pragmatic-elixir-meetup/rpi_video","last_synced_at":"2026-05-30T21:31:42.253Z","repository":{"id":143114026,"uuid":"204695824","full_name":"Pragmatic-Elixir-Meetup/rpi_video","owner":"Pragmatic-Elixir-Meetup","description":"Elixir version of H264 video record on Raspberry Pi ","archived":false,"fork":false,"pushed_at":"2020-02-12T06:29:46.000Z","size":1135,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-03T08:45:04.461Z","etag":null,"topics":["elixir-wrapper","h264","raspberry-pi-camera"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/Pragmatic-Elixir-Meetup.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":"2019-08-27T12:14:09.000Z","updated_at":"2020-02-12T06:29:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"6df3218d-e058-422f-ae48-af88c6702dde","html_url":"https://github.com/Pragmatic-Elixir-Meetup/rpi_video","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Pragmatic-Elixir-Meetup/rpi_video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragmatic-Elixir-Meetup%2Frpi_video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragmatic-Elixir-Meetup%2Frpi_video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragmatic-Elixir-Meetup%2Frpi_video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragmatic-Elixir-Meetup%2Frpi_video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Pragmatic-Elixir-Meetup","download_url":"https://codeload.github.com/Pragmatic-Elixir-Meetup/rpi_video/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Pragmatic-Elixir-Meetup%2Frpi_video/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27366318,"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-11-29T02:00:06.589Z","response_time":56,"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":["elixir-wrapper","h264","raspberry-pi-camera"],"created_at":"2024-11-14T04:40:22.134Z","updated_at":"2025-11-29T22:03:06.099Z","avatar_url":"https://github.com/Pragmatic-Elixir-Meetup.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rpi_video\n\nThis project implements `H264` video record on Raspberry Pi. It wraps a Rust\nH264 video record library `rpi-video-rs` which has already implemented the low\nlevel features. By taking advantage of\n[Erlang Port](http://erlang.org/doc/tutorial/c_port.html), the simple\n[Elixir GenServer](https://hexdocs.pm/elixir/GenServer.html) APIs are provided.\n\nSince it is an experimental project, not the full video record features of\nRaspberry Pi are supposed to be implemented. If you have any ideas or need some\nhelps, feel free to send an email to asongala@163.com.\n\n## Usage\n\nAdd the following to your `mix.exs`:\n\n```exs\ndefp deps do\n  [\n    {:rpi_video, \"0.0.1\"}\n  ]\nend\n```\n\nGet the dependencies and compile (if something went wrong, please reference the\nbelow `Development` part for details):\n\n```\nmix deps.get\nmix compile\nmix compile.cargo\n```\n\nRun on a `iex` console:\n\n```\niex -S mix\niex(1)\u003e RpiVideo.start(true)    # true for MockServer, and false for RealServer.\niex(2)\u003e RpiVideo.record(true)   # same as above\niex(3)\u003e RpiVideo.stop(true)     # same as above\n```\n\n## Development\n\nThis project provides two Elixir GenServer implementations `MockServer` and\n`RealServer`.\n\nThe MockServer is used for debugging, and compiled only for Apple Mac\n(`{:unix, :darwin}`). It simulates the asynchronous process of video record, but\nno video is captured and saved.\n\nThe RealServer could only be compiled and run on a Raspberry Pi. It could\ncapture and save videos from a camera.\n\nThe Rust implementations of MockServer and RealServer are compiled by the below\ncommand which could identify the current target platform (Mac or Raspberry Pi).\nReference the source code in `lib/mix/tasks/compile.cargo.ex` for details.\n\n```\nmax compile.cargo\n```\n\nSince this project requires the real camera to record H264 videos finally, you\nneeds a RPI to run or test. But you could also uses a cross-compiling\nenvironment for compiling and developing. Reference the\n[docker folder](https://github.com/Pragmatic-Elixir-Meetup/rpi-video-rs/tree/master/tools/docker)\nof project [rpi-video-rs](https://github.com/Pragmatic-Elixir-Meetup/rpi-video-rs)\nwhich is a separate cross-compiling environment.\n\nFor developing on either a RPI device or a Docker container, you should install\nthe standard Rust development environment, and then adds Rust targets as below.\n\n```\nrustup target add arm-unknown-linux-gnueabihf\nrustup target add armv7-unknown-linux-gnueabihf\n```\n\nReference below for how to enable a camera on Raspberry Pi.\n\n### Installing Camera Device on RPI\n\n1. Adds text `bcm2835-v4l2` to the bottom of file `/etc/modules`.\n\n```\nsudo echo bcm2835-v4l2 \u003e\u003e /etc/modules\n```\n\n2. Activates the camera in configuration.\n\n```\nsudo raspi-config\n```\n\n3. Follows the prompt to reboot Raspberry PI.\n\n4. You could use the command `raspivid` to test recording a `H264` video and\ncheck if the camera is installed properly.\n\n```\nraspivid -o test_video.h264\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragmatic-elixir-meetup%2Frpi_video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpragmatic-elixir-meetup%2Frpi_video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpragmatic-elixir-meetup%2Frpi_video/lists"}