An electron native module for recording video for use with CrewTimer. The package uses 'prebuild' to build native versions and store them in github releases so projects which use this module do not have to build the module.
Building this native module on windows requires building both opencv and ffmpeg from source to allow static linking to the C++ code. This requires build tools and a few custom scripts.
On MacOS, the following brew modules are required to be installed.
Install brew from brew.sh
brew install nvm
brew install nasm
brew install yasm
brew install pkg-config
brew install cmake
A unix like environment is needed to build ffmpeg and opencv. Cygwin is used to establish a unix-like environment. Install the following:
- nvm for windows
- git for windows
- Visual Studio Community with C++ addon
- cmake
- Python. Just type
python
on windows to get prompted to install. It is installed already on macos. - Cygwin 64 bit. Add 'yasm' and 'make' modules.
Either check out the git repo or if in a Macos Parallels Desktop, map a network drive to share the git repo.
In windows explorer, navigate to the scripts/ folder and double click on the Cygwin-vstudio.bat file. This will open a bash terminal with the visual studio tools available from the command line.
Set up nvm/node:
nvm install 18
nvm use 18
npm i -g yarn
Build ffmpeg and opencv:
cd crewtimer-video-review/native/ffreader
./scripts/build-opencv.sh
./scripts/build-ffmpeg.sh
Build the module and upload to github:
yarn install
yarn prebuild
The result is placed into a file such as prebuilds/crewtimer_video_reader-v1.0.2-napi-v6-win32-x64.tar.gz.
The yarn prebuild
command will also upload the binary module to github if a ~/.prebuildrc file with a github token is present such as
upload=ghp_kQ04DpisXo2hTiLt2syssyssysysysysysy
token=ghp_kQ04DpisXo2hTiLt2syssyssysysysysysy
Optionally manually upload the tar.gz file to github releases.
On mac: mkdir build && cd build && cmake .. && make
On windows first build ffmpeg:
./configure --extra-cflags="-O2 /GS-" --extra-cxxflags="-O2 /GS-" \
--prefix=../src/ffmpeg-built-win --enable-static --enable-gpl --disable-network \
--disable-doc --disable-postproc --toolchain=msvc && make && make install
Then build the local executable:
mkdir build && cd build
cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=cl ..
make
Increase kernel udp buffer size: sudo sysctl -w net.inet.udp.maxdgram=4000000
The following NDI capable cameras are good candidates for use with CrewTimer Video Recorder. The ones marked as Verified are known to stream continuously without issue. The others are untested by CrewTimer. If you find an NDI camera that works well for you please let me know so I can add it to the list.
Price | Zoom | PTZ | FPS | Weather | Verified | Model |
---|---|---|---|---|---|---|
$1450 | 20X | Yes | 120 | Yes | AIDA PTZ-NDI3-X20 | |
$1075 | 30X | 60 | Yes | AIDA UHD-NDI3-X30 | ||
$799 | 30X | Yes | 60 | Yes | AVKANS NDI PTZ Camera | |
$719 | 30X | Yes | 60 | Yes | SMTAV BX30N | |
$775 | 1X C/CS | 120 | IP67 | AIDA HD-NDI3-IP67 | ||
$669 | 20X | Yes | 60 | SMTAV BX20N | ||
$1295 | 20X | 60 | Birddog Maki Ultra 4K | |||
$1295 | 30x | Yes | 60 | BirdDog Eyes P200 |
Note:Cameras often needed software upgrades to operate properly. Be sure to update software as soon as you purchase one. The SMTAV BA series had unreliable NDI timestamps and are not recommended.