Python port of the thermal camera viewer by atomic14 with a PySide6 desktop UI.
- Live thermal stream from USB camera via OpenCV (
cv2.VideoCapture) - Colormap rendering:
Turbo,Inferno,Jet,Hot,Black-Hot,White-Hot,Rainbow,Rainbow-High-Contrast,Parula,Viridis,Plasma,Coolwarm,Magma,Twilight,Autumn,Spring,Winter,HSV,Cubehelix,Cividis,Bone - Temperature stats: Min, Max, Average, Center
- Optional temperature grid overlay
- Optional min/max markers with smart labels
- Preview scaling with aspect ratio lock and selectable interpolation (
Nearest/Linear/CubicLow CPU,LanczosMedium CPU,SharpHigh CPU) - Optional Sharp preview/export upscaling via ESPCN x4 (
opencv-contribdnn_superres; display-only) - Histogram with active colormap scale
- 1 minute temperature history chart (Max/Min/Ave/Center)
- Manual temperature range (optional)
- Camera temperature range switch (
Low (-20~150°C)/High (100~600°C)) - High-range measurement smoothing for more stable values (Min/Max/Average/Center, grid, min/max markers)
- Orientation controls (rotate/flip)
- PNG snapshot export
- MP4 recording export
- Shared export directory for PNG and MP4 (persisted)
- Keyboard shortcuts:
p(save PNG instantly),r(start/stop recording instantly) - Persistent UI state (camera selection, colormap, controls, window size)
- macOS, Linux, or Windows (OpenCV camera backend)
- Python 3.11+
For camera temperature range switching, pyusb also requires a working libusb backend on the system.
From the repository root:
python3 -m venv .venv
source .venv/bin/activate
pip install -e .For development and test tooling, use pip install -e ".[dev]".
- macOS:
brew install libusb
- Linux:
- install
libusb-1.0via your package manager (distribution-specific package name) - ensure user/device permissions allow USB control access
- install
- Windows:
- Install
libusb-1.0.dlland ensure it is onPATH(for exampleC:\Tools\libusb). - For temperature-range control and live video at the same time, install a
libusb-win32 upper filter with Zadig
(do not replace the UVC camera driver):
- Options → List All Devices
- Select
USB Camera (Interface 0)forVID_0BDA/PID_5830 - Choose
libusb-win32 - Open the arrow next to Replace Driver and choose Install Filter Driver
- Confirm Windows still shows a normal
USB Video Device/ Camera entry
- IrProPyCapture uses the libusb0 pyusb backend on Windows to talk to that filter.
- Start the camera stream in IrProPyCapture before switching temperature range.
- Replacing Interface 0 with WinUSB/libusb (instead of a filter) removes the webcam from Windows/OBS and breaks capture.
- Install
From the repository root:
source .venv/bin/activate
python -m irpropycapture.main- Click Refresh Cameras.
- Select the desired thermal camera.
- Click Start Camera.
- Adjust colormap, orientation, grid, manual range, and marker options.
- Use Save PNG for snapshots and Start/Stop Recording for MP4.
- These buttons keep the save dialog and update the shared export directory.
- Use keyboard shortcuts for quick actions (without save dialog):
psaves a PNG immediately in the shared export directory.rstarts/stops MP4 recording immediately in the shared export directory.
This Python port is based on the awesome original Swift/macOS project by atomic14. https://github.com/atomic14/InfiRayCapture Many thanks to the original author for the groundwork and implementation details. Range selection was made possible thanks to hints from the project by LeoDJ https://github.com/LeoDJ/P2Pro-Viewer
- On first run, the OS may request camera permission.
- UI state is stored in
~/.irpropycapture_state.json. - PNG and MP4 share one persisted export directory.
- If no image appears, verify camera access permissions and that the camera is not used by another application.
- Optional performance logs can be enabled with
IRPRO_PY_CAPTURE_PERF=1.
-
macOS:
- Current thermal-camera path prefers AVFoundation via OpenCV FFMPEG input source (
USB-Kamera:none) for the known USB device. - If the thermal stream is not found, verify camera permissions in System Settings and close other apps using the device.
- Current thermal-camera path prefers AVFoundation via OpenCV FFMPEG input source (
-
Linux:
- Capture uses OpenCV V4L2 backend and probes camera indices for raw-compatible formats (
Y16/YUYV/UYVY). - Ensure your user can access
/dev/video*devices (udev/group permissions). - For temperature range switching, also ensure USB access permissions for the thermal device (libusb path).
- Capture uses OpenCV V4L2 backend and probes camera indices for raw-compatible formats (
-
Windows:
- Capture uses OpenCV MSMF backend first, then DirectShow fallback for broader USB camera compatibility.
- If no stream opens, verify camera privacy settings and close software that may lock the camera.
- Temperature range switching needs
libusb-1.0.dllonPATHplus a libusb-win32 filter on Interface 0 (see USB backend setup above). A plain UVC binding is enough for video, but vendor control transfers then fail withEntity not found.