Message Format
This is a client-to-server event that you send to transmit image data.string
required
Event type. Must be
"realtime.input_image".object
required
Event data object containing the image content and reply flag.
Request Example
Message Structure
Usage Scenarios
Scenario 1: Periodic Scene Recognition
Send camera frames periodically (e.g., every 2 seconds) without requesting replies:Scenario 2: On-demand Visual Q&A
User asks “What do you see?” - capture and send withreply: 1:
Scenario 3: Hybrid Approach (Recommended)
Combine periodic background capture (reply: 0) with on-demand analysis (reply: 1):
Best Practices
Image Format and Quality
Image Format and Quality
- Format: Use JPEG for optimal compression and compatibility
- Quality: Set to 0.7 (70%) to balance quality and payload size
- Resolution: 640x360 is sufficient for most recognition tasks
- File Size: Target 20-50KB per frame after compression
Transmission Frequency
Transmission Frequency
- Periodic capture: 2-3 seconds interval for most use cases
- Adjust based on use case:
- Fast-moving scenes: 1 second
- Static scenes: 3-5 seconds
- Don’t exceed 1 frame per second to avoid overwhelming the AI and consuming excessive bandwidth
Error Handling
Error Handling
Related Events
Camera Recognition Guide
Complete guide for implementing camera recognition with both WebRTC and snapshot methods
WebRTC Connection
Learn how to set up WebRTC connections for video transmission
For more details on camera recognition implementation, including WebRTC video stream transmission, see the Camera Recognition guide.