Skip to content

Commit

Permalink
Move Capture to reprostim-videocapture, #116.
Browse files Browse the repository at this point in the history
  • Loading branch information
vmdocua authored and yarikoptic committed Dec 18, 2024
1 parent 85db7ca commit 6a53de5
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 18 deletions.
25 changes: 19 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,26 +123,30 @@ subjects.

On Debian

```shell
apt-get install -y ffmpeg libudev-dev libasound-dev libv4l-dev libyaml-cpp-dev libspdlog-dev catch2 v4l-utils libopencv-dev libcurl4-openssl-dev nlohmann-json3-dev cmake g++
```

"Parsing/parse_wQR.py" script requires in zbar to be installed as well:

```shell
apt-get install -y libzbar0

````

## Build

cd Capture
```shell
cd src/reprostim-capture
mkdir build
cd build
cmake ..
make

```

## Subdirectories Structure

### Capture
### src/reprostim-capture

Contains all code needed for setting up video capture. This includes C++
code for interfacing with the video capture device, and scheme for setting
Expand Down Expand Up @@ -188,7 +192,9 @@ it can accidentally produce the same error message ERROR[003].

This is optional step, only for information purposes:

```shell
lsusb
```

And locate line with device, e.g.:

Expand All @@ -198,8 +204,9 @@ In this sample, 2935 is the "Vendor ID", and 0008 is the "Product ID".

Optionally Magewell device name and serial number can be quickly checked with this command:

```shell
lsusb -d 2935: -v | grep -E 'iSerial|iProduct'

```

### 2) Create "udev" rules
Create text file under "/etc/udev/rules.d/189-reprostim.rules" location with
Expand All @@ -217,18 +224,24 @@ Note: we can see that "ATTR{idVendor}" value 2935 is equal to one we got in
step 1) from lsusb utility.

Also sample udev rules configuration added to project under
"Capture/etc/udev/189-reprostim.rules" location.
"src/reprostim-capture/etc/udev/189-reprostim.rules" location.

Note: make sure the file has owner "root", group "root" and 644 permissions:

```shell
ls -l /etc/udev/rules.d/189*
````
```
-rw-r--r-- 1 root root 72 ... /etc/udev/rules.d/189-reprostim.rules
```
### 3) Add user to "plugdev" group
Make sure the user running VideoCapture utility is a member of the
"plugdev" group, e.g.:
```shell
sudo usermod -aG plugdev TODO_user
```
### 4) Restart computer
Restart computer to make changes effect.
Expand Down
9 changes: 5 additions & 4 deletions docs/design/rf-library.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ Refactor stuff here into cleanly separated and documented libraries etc.

## Refactor log

| Old | New |
|-----------|-------------------------|
| `Capture` | `src/reprostim-capture` |
| `Events` | `src/reproevents` |
| Old | New |
|---------------|-------------------------|
| [x] `Capture` | `src/reprostim-capture` |
| [ ] `Events` | `src/reproevents` |
| [ ] `TBD` | `TODO` |
28 changes: 20 additions & 8 deletions src/reprostim-capture/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
# ReproStim Capture
# reprostim-capture

## Overview

Capture project is set of tools and utilities to capture video/audio signal with Magewell
`reprostim-capture` project is set of tools and utilities to capture video/audio signal with Magewell
USB Capture devices and save it to a file. It is a part of the ReproStim project.

## Dependencies

### On Debian:

```shell
apt-get install -y ffmpeg libudev-dev libasound-dev libv4l-dev libyaml-cpp-dev libspdlog-dev catch2 v4l-utils libopencv-dev libcurl4-openssl-dev nlohmann-json3-dev cmake g++
````

Optionally, in case `con/duct` tool is used and `conduct_opts.enabled` is set to true in reprostim-videocapture `config.yaml`:

```shell
apt-get install -y python3-pip
python3 -m venv venv
source venv/bin/activate
pip install con-duct
duct --version
```

### Project requirements:
- OS Linux
Expand All @@ -44,29 +48,33 @@ Optionally, in case `con/duct` tool is used and `conduct_opts.enabled` is set to

## Build

Capture uses CMake as build system. To build the project, run the following commands:
`reprostim-capture` uses CMake as build system. To build the project, run the following commands:

cd Capture
```shell
cd src/reprostim-capture
mkdir build
cd build
cmake ..
make
```

## Installation

To install the project, once the build done, run the following command:

cd Capture
```shell
cd src/reprostim-capture
sudo cmake --install build
```

It will copy all necessary files to the `/usr/local/bin` location (`reprostim-videocapture`,
`reprostim-screencapture`, `reprostim-nosignal`).

## Project Structure

Capture project consists of the following components:
`reprostim-capture` project consists of the following components:
- `capturelib` - shared static C++ library with common code across all utilities.
- `screencapture` - project source code for "reprostim-screencapture" command-line
utility. The program captures screenshots from Magewell USB Capture device and saves
Expand Down Expand Up @@ -98,9 +106,11 @@ set the version. Where {MAJOR}, {MINOR} and {PATCH} values should be set manuall
We also have CMake script "version-auto-inc.cmake" which can be used to increment
build number in version file during development process:

cd Capture
```shell
cd src/reprostim-capture
cmake -P version-auto-inc.cmake
```


E.g. in CLion IDE, you can add "version-auto-inc.cmake" as External Tool under
Expand All @@ -116,8 +126,10 @@ with build process (as pre-build hook) to increment build number automatically.
In short words project uses CMake + CTest + Catch2 for unit testing. To run tests,
build project and execute the following command:

cd Capture/build
```shell
cd src/reprostim-capture/build
ctest
```

Root project and each subproject have their own tests located in the "test" directory
along with CMakeList.txt and C++ sources.
Expand Down

0 comments on commit 6a53de5

Please sign in to comment.