LiDAR Converter
A Python library for automatically converting raw LiDAR sensor data (PCAP format) from various manufacturers into standardized LAS/LAZ formats. The system detects which sensor produced the data, selects the appropriate SDK or library, and performs conversion to ensure compatibility with major geospatial and point cloud tools.
Features
- 🔍 Automatic Vendor Detection: Multi-method detection using UDP ports, packet structure, magic bytes, and companion files
- 🔄 Multi-Vendor Support: Supports Ouster, Velodyne, and Livox sensors with unified conversion pipeline
- 📦 Multiple Output Formats: Converts to LAS, LAZ, PCD, BIN (KITTI), and CSV formats
- ⚡ Optimized Processing: Fast conversion with configurable scan limits and streaming PCAP processing
- 🛠️ Easy Integration: Simple Python API and comprehensive CLI for automation
- 🏥 Health Monitoring: Built-in health checks and SDK validation
- 📊 Batch Processing: Convert multiple files efficiently with progress tracking
Supported Sensors
- ✅ Ouster: OS-0, OS-1, OS-2, OS-Dome series (16/32/64/128 channels)
- ✅ Velodyne: VLP-16, VLP-32C, HDL-32E, HDL-64E, VLS-128
- ✅ Livox: Avia, Horizon, Tele-15, Mid-40/70 (All formats supported)
- ✅ Hesai: Pandar128E3X (128ch, calibrated angle tables), PandarXT-32, PandarXT-16, Pandar64, Pandar40P, PandarQT
- 🚧 RoboSense: RS-LiDAR-M1, RS-Ruby, RS-Helios (planned)
Supported Formats
Input Formats
| Format | Ouster | Velodyne | Livox | Hesai | Notes |
|---|---|---|---|---|---|
| PCAP | ✅ | ✅ | ✅ | ✅ | Requires metadata JSON for Ouster |
| CSV | ❌ | ❌ | ✅ | ❌ | Livox Viewer export format |
| LVX | ❌ | ❌ | ✅ | ❌ | Livox proprietary format |
| LVX2 | ❌ | ❌ | ✅ | ❌ | Livox proprietary format v2 |
Output Formats
| Format | Ouster | Velodyne | Livox | Hesai | Description | Best For |
|---|---|---|---|---|---|---|
| LAS | ✅ | ✅ | ✅ | ✅ | ASPRS LASer format (uncompressed) | GIS, surveying, general use |
| LAZ | ✅ | ✅ | ✅ | ✅ | Compressed LAS format | Storage optimization, archival |
| PCD | ✅ | ✅ | ✅ | ✅ | Point Cloud Data (PCL format) | Robotics, ROS, PCL tools |
| BIN | ✅ | ✅ | ✅ | ✅ | Binary format (KITTI standard) | Machine learning, autonomous driving |
| CSV | ✅ | ✅ | ✅ | ✅ | Comma-separated values | Data analysis, spreadsheets, custom processing |
Legend:
- ✅ Fully supported
- 🚧 In progress
- ❌ Not supported
Format Details
LAS (ASPRS Standard)
- Industry-standard format for LiDAR data exchange
- Includes point coordinates (X, Y, Z) and intensity
- Compatible with CloudCompare, PDAL, QGIS, ArcGIS
- File size: ~30-40 MB per million points
LAZ (Compressed LAS)
- LASzip-compressed LAS format
- 60-80% smaller than LAS files
- Lossless compression
- Automatic compression using laspy 2.0+ or external laszip tool
- File size: ~10-15 MB per million points
PCD (Point Cloud Library)
- Native format for Point Cloud Library (PCL)
- ASCII format for maximum compatibility
- Includes point coordinates and intensity
- Ideal for robotics and ROS applications
- File size: ~60-80 MB per million points
BIN (KITTI Format)
- Binary format used by KITTI dataset
- Raw float32 values: [x, y, z, intensity] per point
- Little-endian byte order
- Optimized for machine learning pipelines
- File size: ~16 MB per million points (16 bytes/point)
CSV (Comma-Separated Values)
- Human-readable text format
- Header row: x, y, z, intensity
- Easy to import into Excel, pandas, MATLAB
- Good for data analysis and visualization
- File size: ~60-80 MB per million points
Installation
Prerequisites
- Python 3.8+
- Microsoft Visual C++ Redistributable 2015-2022 (x64) for Windows
SDK Notes
| Vendor | SDK | Status |
|---|---|---|
| Ouster | ouster-sdk (PyPI) |
Full SDK — accurate point cloud extraction |
| Velodyne | velodyne-decoder (PyPI) |
Full SDK — supports VLP-16, VLP-32C, HDL-32E, HDL-64E, VLS-128 |
| Hesai | C++ SDK (Linux only, bundled in Wrappers/hesai_sdk/) |
dpkt-based parsing on Windows with official Pandar128E3X angle correction tables |
| Livox | No Python SDK available | dpkt-based parsing for PCAP; native parser for LVX/LVX2 |
Install from PyPI (Recommended)
pip install lidar-converter
Verify installation:
lidar-converter health
Install from Source (Alternative)
- Clone the repository:
git clone https://github.com/Param-Patel-o5/lidar-multi-convert.git
cd lidar-multi-convert
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies (editable install recommended for development):
pip install -r requirements.txt
pip install -e .
- Verify installation:
lidar-converter health
# or: python -m Lidar_Converter.cli health
SDK vs PCAP parsing
| Vendor | Conversion backend | Notes |
|---|---|---|
| Ouster | ouster-sdk (PyPI, C++ bindings) | Requires companion .json metadata file next to the PCAP. |
| Velodyne | velodyne-decoder (PyPI, C++ bindings) | Model auto-detected from filename; dpkt used as fallback if not installed. |
| Livox | dpkt (PCAP) / native parser (LVX/LVX2) | No Python SDK exists for file conversion. dpkt is the primary method. |
| Hesai | dpkt (Windows) / C++ SDK if built on Linux | Model auto-detected from packet header (laser_num). Pandar128E3X uses official per-channel elevation + azimuth correction tables from the angle correction CSV. |
GitHub source repo: github.com/Param-Patel-o5/lidar-multi-convert (PyPI package name remains lidar-converter).
Run lidar-converter health to confirm which backend each wrapper is using on your machine.
Quick Start
Automatic Conversion (Any Supported Vendor)
from Lidar_Converter.converter import LiDARConverter
# Initialize converter
converter = LiDARConverter()
# Automatic vendor detection and conversion to LAS
result = converter.convert(
input_path="data.pcap",
output_path="output.las",
max_scans=1000 # Optional: limit for faster processing
)
if result["success"]:
print(f"Converted {result['points_converted']} points from {result['vendor']}")
else:
print(f"Error: {result['message']}")
Converting to Different Output Formats
Note: Output format is automatically detected from the file extension! No need to specify output_format parameter.
from Lidar_Converter.converter import LiDARConverter
converter = LiDARConverter()
# Format is auto-detected from file extension
# Convert to LAZ (compressed LAS)
result = converter.convert(
input_path="data.pcap",
output_path="output.laz" # .laz extension → LAZ format
)
# Convert to PCD (Point Cloud Library format)
result = converter.convert(
input_path="data.pcap",
output_path="output.pcd", # .pcd extension → PCD format
preserve_intensity=True # Include intensity values
)
# Convert to BIN (KITTI format for ML)
result = converter.convert(
input_path="data.pcap",
output_path="output.bin" # .bin extension → BIN format
)
# Convert to CSV (for data analysis)
result = converter.convert(
input_path="data.pcap",
output_path="output.csv", # .csv extension → CSV format
preserve_intensity=True
)
Format-Specific Use Cases
# For GIS and surveying (compressed storage)
converter.convert("scan.pcap", "survey_data.laz") # Auto-detects LAZ format
# For robotics and ROS applications
converter.convert("scan.pcap", "robot_scan.pcd") # Auto-detects PCD format
# For machine learning training (KITTI format)
converter.convert("scan.pcap", "training_data.bin") # Auto-detects BIN format
# For data analysis in Python/Excel
converter.convert("scan.pcap", "analysis.csv") # Auto-detects CSV format
Command Line Usage
# Check system health
python Lidar_Converter/cli.py health
# Detect vendor automatically
python Lidar_Converter/cli.py detect data.pcap
# Convert - format auto-detected from file extension (no --format flag needed!)
python Lidar_Converter/cli.py convert data.pcap -o output.las --max-scans 1000
python Lidar_Converter/cli.py convert data.pcap -o output.laz --max-scans 1000
python Lidar_Converter/cli.py convert data.pcap -o output.pcd --max-scans 1000
python Lidar_Converter/cli.py convert data.pcap -o output.bin --max-scans 1000
python Lidar_Converter/cli.py convert data.pcap -o output.csv --max-scans 1000
# Or explicitly specify format (optional)
python Lidar_Converter/cli.py convert data.pcap -o output.laz --format laz
# Batch convert multiple files (preserves format from output path)
python Lidar_Converter/cli.py batch ./data_dir -o ./output_dir
# Convert with validation
python Lidar_Converter/cli.py convert data.pcap -o output.las --validate
Project Structure
lidar-converter/ # PyPI name; clone: lidar-multi-convert
├── pyproject.toml # Package metadata and tool config
├── requirements.txt # Runtime deps (mirrors pyproject)
├── README.md
├── TESTING_GUIDE.md # Manual CLI checks, SDK notes, Windows/Rich notes
├── Lidar_Converter/ # Main package
│ ├── __init__.py
│ ├── cli.py # Command line interface
│ ├── converter.py # Main conversion orchestrator
│ ├── detector.py # Multi-method vendor detection
│ ├── CLI_README.md # CLI reference (accurate for current argparse CLI)
│ └── Wrappers/ # Vendor-specific wrappers
│ ├── base_wrapper.py
│ ├── ouster_wrapper.py
│ ├── velodyne_wrapper.py
│ ├── livox_wrapper.py
│ ├── hesai_wrapper.py
│ └── README.md
└── .gitignore
Performance
The converter is optimized for fast processing with configurable scan limits:
Processing Speed (50 scans, measured on real sample data)
| Vendor | Backend | Points | Time | Pts/sec |
|---|---|---|---|---|
| Ouster OS (urban drive) | ouster-sdk (C++) | 11,353,627 | 8.73s | ~1.3M/s |
| Velodyne VLP-16 | velodyne-decoder (C++) | 1,014,855 | 0.52s | ~2.0M/s |
| Velodyne VLS-128 | velodyne-decoder (C++) | 5,568,032 | 4.16s | ~1.3M/s |
| Hesai Pandar128E3X | dpkt (Python) | 12,026 | 0.16s | ~75K/s |
| Livox HAP (PCAP) | dpkt (Python) | 100,008 | 0.77s | ~130K/s |
SDK-backed vendors (Ouster, Velodyne) process 1–2 million points/second — comparable to industry-standard tools. dpkt-based vendors (Hesai, Livox) are 10–30x slower because all packet parsing happens in pure Python. For Hesai and Livox, use --max-scans to limit processing during development.
Scan Limiting
Use --max-scans to process only a portion of the file for faster testing:
# Process only first 10 scans (fast preview)
python Lidar_Converter/cli.py convert data.pcap -o output.las --max-scans 10
# Process full file (omit --max-scans)
python Lidar_Converter/cli.py convert data.pcap -o output.las
Note: Livox uses point-based limiting internally (1 scan ≈ 100,000 points) for optimal performance.
Development
See TESTING_GUIDE.md for manual detect / convert command examples (all output formats), SDK notes, and Windows console tips.
Quick checks:
lidar-converter --output-format json health
lidar-converter --output-format json detect sample.pcap
lidar-converter convert sample.pcap -o out.las --max-scans 100
lidar-converter test sample.pcap
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
- Ouster SDK for LiDAR data processing
- LASpy for LAS file handling
- CloudCompare for point cloud visualization
Vendor Detection Methods
The system uses multiple detection methods with weighted confidence scoring:
- UDP Port Detection (35% weight): Analyzes destination ports (Ouster: 7502/7503, Velodyne/Hesai: 2368/2369, Livox: 57000)
- Packet Structure (30% weight): Checks magic bytes in UDP payload (Ouster: 0x0001, Velodyne: 0xFFEE, Hesai: 0xEEFF)
- Magic Bytes (30% weight): File header signatures
- Companion Files (25% weight): Required metadata files (e.g., Ouster JSON)
- Packet Size (20% weight): UDP payload size patterns (Velodyne: 1206 bytes, Hesai: 861 bytes)
- File Extension (5% weight): File extension hints
Minimum confidence threshold: 14% for positive detection.
Roadmap
-
Add Velodyne sensor support -
Add Livox sensor support (Avia, Horizon) -
Implement LAZ compression -
Add PCD, BIN, and CSV output formats -
Add Hesai sensor support (PandarXT, Pandar64, Pandar40P) -
Enable LAZ compression for all vendors (lazrs) - Add RoboSense sensor support (RS-LiDAR-M1, RS-Ruby, RS-Helios)
- Add binary PCD format support
- Add E57 and PLY format support
- Create Docker container
- Add CI/CD pipeline (optional)
- Performance optimizations (parallel processing)
- Web interface for conversion
Metadata
Release files for lidar-converter 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lidar_converter-0.2.0.tar.gz | 113.4 kB | Without provenance | Details for lidar_converter-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lidar_converter-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for lidar_converter-0.2.0-py3-none-any.whl |
Total release size: 247.0 kB
Release files / lidar_converter-0.2.0.tar.gz
| Download URL | lidar_converter-0.2.0.tar.gz |
|---|---|
| Size | 113.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6adfb5a0a49bf15aee0ebbf8df4dc01f360c7ad4bf390d45c6acef7eee9ce4b
|
|
BLAKE2b-256 checksum How to use checksums |
fe91e4b3072d204f989aa2204f4868ee12eb1400f060411e3345cb5cf2a07ef8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Release files / lidar_converter-0.2.0-py3-none-any.whl
| Download URL | lidar_converter-0.2.0-py3-none-any.whl |
|---|---|
| Size | 133.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7d35150c41da411f8ec09bc289a017d8fb5fee81cc86b8169e77109999ec7d01
|
|
BLAKE2b-256 checksum How to use checksums |
d4f55cf78d82198244f662b5b15d8929760e0e3da3461b6a1a1803928d70e52d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.3
|
Security for lidar-converter 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.