Skip to content

Commit

Permalink
add make install target (closes #12)
Browse files Browse the repository at this point in the history
  • Loading branch information
floe committed Feb 7, 2022
1 parent f9a6bbb commit bda2705
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,11 @@ surfacecast: surfacecast.o Camera.o V4L2.o SUR40.o VirtualCam.o ${OBJECTS}

clean:
-rm *.o gmon.out ${TARGETS}

install: loopback ${TARGETS}
cp -v ${TARGETS} /usr/local/bin/

loopback:
cp -vn config/v4l2loopback-autoload.conf /etc/modules-load.d/
cp -vn config/v4l2loopback-options.conf /etc/modprobe.d/
modprobe v4l2loopback
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,21 @@ This tool records live video of a flat surface with a depth camera, automaticall

[![SurfaceStreams Video](assets/anim.gif)](https://www.youtube.com/watch?v=Qe1BROtGyzI "SurfaceStreams Video")

### Building

```
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libopencv-dev libeigen3-dev
[optional] install libk4a1.4-dev and/or librealsense2-dev
make && sudo make install
```

### Usage

**Example 1** - debug/config view of plain webcam: `./surfacecast v4l2 /dev/video0`

**Example 2** - stream Realsense to ![virtual camera device](https://github.com/umlaeute/v4l2loopback): `./surfacecast realsense 0 "videoconvert ! video/x-raw,format=RGB,width=1280,height=720 ! v4l2sink device=/dev/video20"` (mind the quotes around the GStreamer pipeline)

For setting up the virtual camera, install `v4l2loopback-dkms`, copy `config/modules.conf` to `/etc/modules-load.d/` and `config/v4l2loopback.conf` to `/etc/modprobe.d/`, and run `sudo modprobe v4l2loopback`.
For setting up the virtual camera, install `v4l2loopback-dkms`, copy `config/v4l2loopback-autoload.conf` to `/etc/modules-load.d/` and `config/v4l2loopback-options.conf` to `/etc/modprobe.d/`, and run `sudo modprobe v4l2loopback` (also part of `make install`).

**Example 3** - simple network stream of Kinect Azure: `./surfacecast k4a 0 "jpegenc ! rtpjpegpay ! udpsink host=..."`

Expand Down Expand Up @@ -46,7 +54,7 @@ If `config.xml` is present in the working directory at startup, parameters are r
Reference platform: Ubuntu 20.04.

* General (V4L2, SUR40, virtual camera):
* gstreamer-1.16 (`libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev`)
* gstreamer-1.16+ (`libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev`)
* opencv-4.2.0 (`libopencv-dev libeigen3-dev`)
* Kinect Azure:
* libk4a-1.4.1 (https://github.com/microsoft/Azure-Kinect-Sensor-SDK)
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/surfacecast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ int get_v4l_devnum(const char* path) {

int main(int argc, char* argv[]) {

std::cout << "\nSurfaceCast v0.2.2 - https://github.com/floe/surfacecast\n" << std::endl;
std::cout << "\nSurfaceCast v0.2.3 - https://github.com/floe/surfacecast\n" << std::endl;

if (argc < 3) {
std::cout << "usage: surfacecast <camtype> <videodev> [\"gstreamer_pipeline\"]\n" << std::endl;
Expand Down

0 comments on commit bda2705

Please sign in to comment.