diff --git a/README.md b/README.md index 51e8bca..7c9aa21 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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.: @@ -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 @@ -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. diff --git a/docs/design/rf-library.md b/docs/design/rf-library.md index 39f57bb..51af8b7 100644 --- a/docs/design/rf-library.md +++ b/docs/design/rf-library.md @@ -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` | \ No newline at end of file +| Old | New | +|---------------|-------------------------| +| [x] `Capture` | `src/reprostim-capture` | +| [ ] `Events` | `src/reproevents` | +| [ ] `TBD` | `TODO` | diff --git a/src/reprostim-capture/README.md b/src/reprostim-capture/README.md index 69c6168..c62287f 100644 --- a/src/reprostim-capture/README.md +++ b/src/reprostim-capture/README.md @@ -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 @@ -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 @@ -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 @@ -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.