Cross-platform terminal-based tool for the FLIR Boson 320+ thermal camera. Supports live streaming and video capture with raw data export.
boson_stream.py— CLI tool for camera streaming and recordingrequirements.txt— Python dependencies
-
Download this repo from Github
-
setup a python virtual environment in the project folder
python -m venv .venv- activate your virtual environment. you'll know it's activated if you see (.venv) followed by your username.
# for Linux/macOS:
source .venv/bin/activate
# for Windows:
.venv/Scripts/activate.ps1- install python dependencies
pip install -r requirements.txt- run
source .venv/bin/activateif not already activated.
IMPORTANT: make sure (.venv) is activated before running any commands!!
help: To view a help menu with a list of available commands
python boson_stream.py helplist: To list available camera devices:
python boson_stream.py listsample output (on macOS):
Listing available camera devices...
Camera index 0: FLIR Camera
Camera index 1: FaceTime HD Camera
Depending on your device, the Boson camera will be named differently. Generally, you'll see something like "FLIR Camera" or "Boson Video"
stream: to view the video stream only. ifcamera_indexis not specified, the camera at index 0 will be selected by default.
python boson_stream.py stream [camera_index]This will pop up a window with a live stream from the camera. TO END STREAMING: click on the window and press q.
note: this command does NOT save any data.
record: to record videos and save raw data in./data/<filename>/. iffilenameis not specified, it will save to a folder with the current timestamp in./data/. if thecamera_indexis not specified, the camera at index 0 will be selected by default. if-n NUM_FRAMESis not specified, it will record indefinitely until you click on the window and pressqto stop.
python boson_stream.py record [filename] [camera_index] [-n NUM_FRAMES]WARNING: do NOT click X or use Ctrl+C to close the window. This will NOT save the files!!!
generally as a good practice, run the list and stream commands first before recording. this ensures that the camera is properly connected and you are using the correct index. also good practice to specify the number of frames to avoid very very large files!
examples:
# to save data to folder ./data/test, using camera at index 2, recording 100 frames
python boson_stream.py record test 2 -n 100
# to save data to folder ./data/<timestamp>, using camera at index 2, recording 100 frames
python boson_stream.py record 2 -n 100
# to save data to folder ./data/<timestamp>, using camera at index 0, recording 100 frames
python boson_stream.py record -n 100
# to save data to folder ./data/<timestamp>, using camera at index 0, recording until I press 'q'
python boson_stream.py recordAfter recording ends, the terminal will output the location of your files.
Recording 100 frames from camera index 0. Press "q" to stop early.
Captured 100 frames.
Recording stopped.
Video saved to: /Users/samanthamallari/Desktop/boson-viewer/data/20260305_154028/20260305_154028.avi
Raw data saved to: /Users/samanthamallari/Desktop/boson-viewer/data/20260305_154028/20260305_154028_raw.npy
CSV saved to: /Users/samanthamallari/Desktop/boson-viewer/data/20260305_154028/20260305_154028_raw_frame0.csvview: to view a playback of a previously recording .avi or .npy file. to exit, click on the window and pressq.
python boson_stream.py view <path/to/file>currently, CSV is not suppported by the playback viewer.
examples:
python boson_stream.py data/20260305_154028/20260305_154028.avi
python boson_stream.py data/20260305_154028/20260305_154028_raw.npyc— pause / resume playbackz— go back 1 frame (while paused)x— go forward 1 frame (while paused)- Trackbar — scrub to any frame
q— quit viewer
Files are saved into ./data/<filename>/:
data/<filename>/
<filename>_<YYYYMMDD_HHMMSS>.avi # video recording
<filename>_<YYYYMMDD_HHMMSS>_raw.npy # raw data (full bit depth)
<filename>_<YYYYMMDD_HHMMSS>_raw_frame0.csv # raw data as CSV (first frame only)
If a filename is not specified,
data/<YYYYMMDD_HHMMSS>/
<YYYYMMDD_HHMMSS>.avi # video recording
<YYYYMMDD_HHMMSS>_raw.npy # raw data (full bit depth)
<YYYYMMDD_HHMMSS>_raw_frame0.csv # raw data as CSV (first frame only)