Skip to main content

Media Routes Overview

Media routes enable processing of visual data including barcode scanning and video streaming. These routes bridge the gap between image/video sources and your MQTT infrastructure.
Like adding eyes to your broker. Media routes let your MQTT broker see and interpret visual data — scanning barcodes off a camera feed or streaming video to a dashboard — without any external processing code.

Barcode Route

The BARCODE route enables encoding and decoding of various barcode formats including QR codes, Code 128, EAN-13, and more.

Basic Syntax

Configuration Parameters

SUPPORTED_FORMATS
string
Comma-separated barcode formats to support (e.g., QR_CODE, CODE_128, EAN_13).

Event Parameters

SOURCE_TOPIC
string
MQTT topic with barcode image (base64) or data to encode.
DESTINATION_TOPIC
string
MQTT topic to publish barcode results.
MODE
string
Operation mode: ENCODE (create barcode) or DECODE (read barcode).
ENABLE_ANNOTATION
boolean
Annotate decoded barcode location on image. Default: false.
ANNOTATED_IMAGE_TOPIC
string
Topic to publish annotated image (for DECODE mode).

Supported Formats

Barcode Examples

Scan barcodes from images:
Input: Base64-encoded image on camera/frameOutput: JSON with decoded data on barcode/decoded:

Video Input Route

The VIDEO_INPUT route captures video frames from RTSP streams, webcams, or video files and publishes them to MQTT topics.

Basic Syntax

Configuration Parameters

SOURCE
string
Video source: RTSP URL, webcam identifier, or file path.
DESTINATION_TOPIC
string
MQTT topic to publish video frames.
FORMAT
string
Output format: JPEG, MJPEG, H264, H265, MP4, MPEGTS.
FRAME_RATE
integer
Frame rate for capture (1-60 fps).
WIDTH
integer
Frame width in pixels.
HEIGHT
integer
Frame height in pixels.
QUALITY
integer
JPEG quality (1-100).

Event Parameters

SOURCE_TOPIC
string
MQTT topic to control video capture.
QUERY
string
Control command: START, STOP, or CAPTURE <duration>.

Video Input Examples

Capture from IP camera:

Video Output Route

The VIDEO_OUTPUT route streams video frames from MQTT to various output protocols.

Basic Syntax

Configuration Parameters

SOURCE_TOPIC
string
MQTT topic with video frames (base64).
OUTPUT_PROTOCOL
string
Output protocol: HTTP, RTSP, UDP, TCP.
OUTPUT_PATH
string
Output path or port for streaming.

Event Parameters

QUERY
string
Control command: START or STOP.

Video Output Examples

Stream via HTTP (MJPEG):
Access stream at: http://broker-ip:8081/video

Complete Example: Vision System

A complete vision system with camera input, barcode scanning, and video streaming:

Best Practices

Use lower frame rates for bandwidth efficiency:
  • Monitoring: 1-5 fps
  • Motion detection: 2-5 fps
  • Barcode scanning: 5-10 fps
  • Live viewing: 15-30 fps
Balance quality and performance:
  • Barcode scanning: 640x480 to 1280x720
  • Monitoring: 1280x720
  • High detail: 1920x1080
JPEG format is ideal for MQTT transport:
  • Reasonable file sizes
  • Wide compatibility
  • Adjustable quality (60-90 recommended)
Configure reconnection for RTSP streams and monitor connection status.

Troubleshooting

  • Verify RTSP URL format and credentials
  • Check camera is accessible on network
  • Ensure port is not blocked by firewall
  • Try alternative RTSP paths (check camera documentation)
  • Ensure image quality is sufficient
  • Check barcode format is in SUPPORTED_FORMATS
  • Verify barcode is properly visible in image
  • Try higher resolution capture
  • Reduce frame rate
  • Lower resolution
  • Decrease JPEG quality
  • Process fewer simultaneous streams
  • Use UDP for lowest latency
  • Reduce frame size and quality
  • Check network bandwidth
  • Use local network when possible

Next Steps

Industrial Routes

Connect to PLCs and industrial equipment.

Route Examples

See complete route configuration examples.
Last modified on May 22, 2026