Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Pragmatic-Elixir-Meetup/rpi-video-rs
Rust version of H264 video record on Raspberry Pi
https://github.com/Pragmatic-Elixir-Meetup/rpi-video-rs
h264 raspberry-pi-camera rust-embedded
Last synced: 23 days ago
JSON representation
Rust version of H264 video record on Raspberry Pi
- Host: GitHub
- URL: https://github.com/Pragmatic-Elixir-Meetup/rpi-video-rs
- Owner: Pragmatic-Elixir-Meetup
- License: mit
- Created: 2019-08-27T12:07:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-03T14:12:09.000Z (about 5 years ago)
- Last Synced: 2024-12-13T20:17:59.083Z (23 days ago)
- Topics: h264, raspberry-pi-camera, rust-embedded
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rpi-video-rs
This project implements `H264` video record on Raspberry Pi. It uses the
`rust-ffi` binding library
[rpi-mmal-rs](https://github.com/Pragmatic-Elixir-Meetup/rpi-mmal-rs).## Usage
Add the following to your `Cargo.toml`:
```toml
[dependencies]
rpi-video-rs = "0.0.3"
```You could checkout the user code in folder `examples/`.
And run the `simple` one as below.```
cargo run --example simple
```## Development
Since this project requires the real camera to record H264 videos, you needs a
RPI to run or test. But you could also uses a cross-compiling environment for
compiling and developing. We offer a Dockerfile (in folder `tools/docker/`)
which is a separate cross-compiling environment.For developing on either a RPI device or a Docker container, you should install
the standard Rust development environment, and then adds Rust targets as below.```
rustup target add arm-unknown-linux-gnueabihf
rustup target add armv7-unknown-linux-gnueabihf
```### Installing Camera Device on RPI
1. Adds text `bcm2835-v4l2` to the bottom of file `/etc/modules`.
```
sudo echo bcm2835-v4l2 >> /etc/modules
```2. Activates the camera in configuration.
```
sudo raspi-config
```3. Follows the prompt to reboot Raspberry PI.
4. You could use the command `raspivid` to test recording a `H264` video and
check if the camera is installed properly.```
raspivid -o test_video.h264
```### C Version Code
1. Enters into the folder `tools/c_ver`, and runs `make` to compile the command
`rpi_video.out`.```
pushd tools/c_ver
make
```2. Runs the build command `rpi_video.out` to record a sample video.
```
./rpi_video.out
```### Rust Simple Example
You could run the Rust simple example as below.
```
cargo run --example simple
```## TODO
1. Integrates with a CI for testing successful compilation.