On-device OCR for video streams in .NET
Recognize text in RTSP camera streams, webcams and video files from C#. OCR runs as a block of the Media Blocks SDK .NET pipeline — on the device, next to preview, recording and streaming.
From €500/year · Lifetime from €1,500
Video OCR is not image OCR in a loop
An image OCR library takes one bitmap. To read text from a camera or a recording with it, you still decode the stream, pick frames, convert them, call the library and keep track of when each frame was shown. In VisioForge SDKs, OCR is a block of the video pipeline: the SDK decodes the source, OcrBlock reads the frames as they pass, and the same frames continue to the screen, a file or a network stream.
Image OCR library vs OCR in the video pipeline
| Typical image OCR library | OcrBlock in a VisioForge pipeline | |
|---|---|---|
| Input | A bitmap your code passes in | Decoded frames from any SDK source: file, webcam, RTSP camera |
| Decoding the video | Your code, with a separate decoder or frame grabber | Done by the pipeline |
| Which frames are read | You pick and convert them | FramesToSkip; frames that arrive while OCR is busy are skipped and counted |
| When the text appeared | You track it yourself | Timestamp on every OnTextDetected event |
| Recording or streaming at the same time | A separate video pipeline | The same pipeline: OcrBlock output goes on to an encoder, a file or a stream |
| Boxes and text in the video | You draw them | DrawResults |
What OCR inside the pipeline gives you
OcrBlock ships in the VisioForge.DotNet.Core.AI package. It has one video input and one video output and runs the PP-OCR models on the frames it receives.
- Decoding is done for you: any source the SDK opens — video files, webcams, RTSP IP cameras — feeds OcrBlock directly
- Text with time and place: each OnTextDetected event carries the frame Timestamp and, for every line, its Text, Confidence and BoundingBox
- OCR next to recording and streaming: frames leave OcrBlock unchanged or with the text drawn in, and go on to an encoder, a file or a network output in the same pipeline
- On the device: PP-OCR models on ONNX Runtime with the CPU, CUDA, DirectML or CoreML provider — no cloud API, no per-call fee, the video stays on the machine
- 100+ languages: point RecognitionModelPath and CharacterDictionaryPath at the PP-OCR model and dictionary for your language; the samples ship the Latin model
- Cross-platform: Windows, macOS, Linux, Android and iOS from one C# codebase; the OCR sample also exists for .NET MAUI
- Cost under control on live video: FramesToSkip = N runs OCR on one frame in N + 1; every setting and its default is in the OCR guide
Where it is used
Searchable recordings
Extract the text of recorded lectures, webinars and screen recordings with the timestamp of each line, and index it.
Broadcast and signage monitoring
Check that lower thirds, tickers and digital signage show the expected text, on a live feed or a recording.
Production lines
Read serial numbers, batch codes and printed labels from a fixed camera while the same stream is recorded for traceability.
IP cameras in retail and warehouses
Read shelf tags and product labels from RTSP cameras on site, without sending video to a cloud OCR service.
Code Examples
Built from the OCR Text Recognition Demo; the recording branch wires the H.264 encoder and MP4 sink the way the Media Blocks samples do.
Extract the text of a video file with timestamps
C#Read text from an RTSP camera and record it to MP4
C#Pipeline
In the RTSP example OcrBlock sits between the camera and the encoder. Recognized text leaves through the OnTextDetected event; the frames go on to the H.264 encoder and the MP4 file.
Frequently Asked Questions
Does the video leave the machine?▼
How is this different from an image OCR library?▼
Can I recognize text and record the stream at the same time?▼
Which SDK do I need?▼
Can I ship the OCR models in a commercial product?▼
Can I combine OCR with other AI blocks?▼
Documentation and samples
OCR text recognition guide
OcrBlock and OcrSettings reference: models, languages, every setting with its default, troubleshooting.
OCR Text Recognition Demo (WPF)
Media Blocks SDK .NET sample: OCR on a webcam, a video file or an RTSP camera, with the bundled PP-OCRv5 models.
OCR Text Recognition MB (MAUI)
Media Blocks OCR sample for .NET MAUI: text recognition from the device camera.
AI blocks in VideoCaptureCoreX and MediaPlayerCoreX
How processing blocks are added to the capture and player engines: insertion order and lifecycle.
License plate recognition (ANPR)
LicensePlateRecognizerBlock: a plate detector and a plate-specific OCR head, faster and more accurate than general OCR for vehicles.
PII redaction
PIIRedactionBlock: blur or pixelate faces, license plates and on-screen text in video, on the device.
Start reading text from video
Download the fully functional 30-day trial and run the OCR samples. Depending on the engine and output, a watermark or unregistered notice may appear.
SDKs with OCR
Media Blocks SDK .NET
Pipeline SDK: put OcrBlock between any source and a renderer, encoder or network output, next to your own processing.
Learn more →Video Capture SDK .NET
Capture SDK: add OcrBlock to VideoCaptureCoreX and recognize text from cameras while you preview and record.
Learn more →Media Player SDK .NET
Player SDK: add OcrBlock to MediaPlayerCoreX and read text from the files and streams you play.
Learn more →From €500/year · Lifetime from €1,500
