C# Barcode Scanner for .NET from Live Video
Read QR codes and 1D barcodes in C# from a webcam, an IP camera, the screen or a video file. The barcode detector is a block in a .NET video pipeline, so you can scan the same video you preview, record or stream, on Windows, macOS, Linux, Android and iOS.
From €500/year · Lifetime from €1,800
A barcode scanner for video, not for scanned documents
Media Blocks SDK .NET and Video Capture SDK .NET read barcodes and QR codes from live video: webcams, IP cameras over RTSP or ONVIF, screen capture and video files. The detector runs inside the video pipeline and raises an event with the barcode type and value whenever it decodes a code in a frame. It is made for applications that already work with video, such as entrance and ticket checks, warehouse and production-line cameras or kiosks. If your input is still images, PDFs or scanned documents, a barcode library for images is the better fit.
Barcode scanning in the two SDKs
| Media Blocks SDK .NET | Video Capture SDK .NET | |
|---|---|---|
| API | BarcodeDetectorBlock in a MediaBlocksPipeline; the OnBarcodeDetected event gives the barcode type, value and timestamp | VideoCaptureCoreX and VideoCaptureCore: set Barcode_Reader_Enabled and handle OnBarcodeDetected; VideoCaptureCore also takes Barcode_Reader_Type |
| Barcode types | QR Code, EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, Codabar, ITF and GS1 DataBar (RSS-14), with UPC-A and UPC-E reported as EAN-13; Data Matrix with DataMatrixDecoderBlock | VideoCaptureCoreX: the same set as BarcodeDetectorBlock. VideoCaptureCore: QR Code, Data Matrix, PDF417, Aztec, EAN-13, EAN-8, UPC-A, UPC-E, Code 128, Code 39, Code 93, Codabar, ITF and RSS-14 |
| Video sources | Any block with a video output: webcams and capture devices, IP cameras over RTSP and ONVIF, screen capture, video files and network streams | The capture sources of the engine: webcams and capture devices, IP cameras over RTSP and ONVIF, screen capture |
| Platforms | Windows, macOS, Linux, Android and iOS | VideoCaptureCoreX: Windows, macOS, Linux, Android and iOS. VideoCaptureCore: Windows |
| Edition | One edition with every block, the barcode detector included | The barcode reader is in every edition, Standard included; IP camera sources need Professional or Premium |
How the scanner works
BarcodeDetectorBlock wraps the zbar barcode detector. It reads each video frame that passes through it and reports the codes it finds.
- OnBarcodeDetected gives the barcode type, the decoded value and the timestamp of the frame on the pipeline timeline; UPC-A and UPC-E codes are reported as EAN-13
- InputOutput mode passes the video on to a preview, an encoder or a stream; InputOnly mode only scans, for services without a screen
- Scanning runs in the same pipeline as preview, recording and streaming, so one camera feed can be recorded and scanned at the same time
- A code that stays in view is reported again on the following frames, so filter repeats by value in your handler
- BarcodeDetectorBlock.IsAvailable() tells you before you build the pipeline whether the detector can run on this machine
- Data Matrix codes are read by a separate block, DataMatrixDecoderBlock, built on libdmtx
Where it is used
Ticket and access control
Check QR codes on tickets and passes at an entrance with a webcam or a tablet camera, and show the live picture to the operator.
Warehouse and production lines
Read barcodes on parcels and parts from fixed IP cameras over RTSP while the same stream is recorded for later review.
Kiosks and self-service terminals
Scan a QR code shown on a phone screen in a WPF, WinUI 3, MAUI or Avalonia application.
Recorded video and screens
Find the barcodes in a video file, or read QR codes shown on the desktop with screen capture.
Code Examples
The first example scans an RTSP camera with Media Blocks SDK .NET; the second turns on the barcode reader of the Video Capture SDK .NET capture engine.
Scan barcodes and QR codes from an RTSP camera
C#Turn on the barcode reader of a webcam capture
C#Where the detector sits
The detector is one block in the pipeline. Video passes through it to the rest of the pipeline, and each decoded code arrives as an event.
Frequently Asked Questions
How do I scan barcodes from a webcam in C#?▼
Can I read QR codes from an IP camera or an RTSP stream?▼
Can I use it in ASP.NET or a server-side service?▼
Which barcode types does it read?▼
Does it work on Linux, macOS, Android and iOS?▼
Do I get the same barcode more than once?▼
Which license do I need?▼
Documentation and samples
Barcode and QR code scanner guide
Step-by-step guide: camera, RTSP, file and screen sources, detection events, repeated codes, platform setup.
Special blocks reference
BarcodeDetectorBlock and DataMatrixDecoderBlock with their events and sample code.
Barcode Detection WPF demo
Media Blocks sample: pick a camera, preview it and list every barcode found.
DataMatrix Detection WPF demo
Media Blocks sample that reads Data Matrix codes from a camera with DataMatrixDecoderBlock.
Barcode reader for .NET MAUI
Media Blocks sample for Android, iOS, Mac Catalyst and Windows, with the camera permission request.
Deployment guide
Deployment overview for Windows, macOS, Linux, Android and iOS, with a link to the detailed guide for each platform.
Start scanning barcodes from video in C#
Download the fully functional 30-day trial and run the barcode samples. Depending on the output, a watermark or unregistered notice may appear.
Which SDK and edition
Media Blocks SDK .NET
Pipeline SDK: BarcodeDetectorBlock and DataMatrixDecoderBlock next to sources, encoders and sinks. One edition with every block.
From €500/year · Lifetime from €1,800
Learn more →Video Capture SDK .NET
Capture SDK: Barcode_Reader_Enabled on VideoCaptureCoreX and VideoCaptureCore. The barcode reader is in every edition; IP cameras need Professional or Premium.
From €250/year · Lifetime from €900
Learn more →Prices are in euros; VAT is added at checkout where it applies. One license covers both engines of Video Capture SDK .NET.
From €500/year · Lifetime from €1,800
