Relevant source files
This page explains how to integrate CAPTION.Ninja with popular streaming software platforms such as OBS Studio, vMix, and others. It covers the technical implementation of embedding caption overlays into your broadcasts, configuring browser sources, and managing display options. For information about customizing the appearance of captions, see CSS Styling. For advanced audio routing configurations, see Advanced Audio Setup.
Sources: README.md35-42
Integration Architecture
CAPTION.Ninja uses a browser-source based integration model with streaming platforms. The fundamental architecture involves a two-component system: a caption source that processes audio and generates text, and a caption display (overlay) that renders the text within your stream.
Sources: README.md16-25 overlay.html608-686
Basic Integration Process
Integrating CAPTION.Ninja with streaming software follows a consistent pattern regardless of which platform you're using:
Sources: README.md38-42
Step-by-Step Integration Instructions
Start the Caption Source:
See AlsoReal weapons analysis- Open https://caption.ninja in Chrome or Edge
- Grant microphone access when prompted
- Configure any desired options (language, translation, etc.)
Obtain the Overlay URL:
- The main interface will display a URL for the overlay
- This URL contains a unique room ID parameter that connects your caption source to the overlay
Add to Streaming Software:
- Add a new Browser Source in your streaming software
- Enter the overlay URL in the source URL field
- Configure dimensions and other browser source properties
Sources: README.md11-14 README.md38-42
OBS Studio Integration
OBS Studio is the most commonly used streaming platform with CAPTION.Ninja. Integration requires adding a Browser Source with specific configurations.
Adding CAPTION.Ninja to OBS
In OBS, click the "+" icon in the Sources panel
Select "Browser" from the sources list
Name your source (e.g., "Captions")
Configure the source properties:
- URL: Paste the overlay URL from CAPTION.Ninja
- Width: 1280 (recommended minimum)
- Height: 720 (recommended minimum)
- Use custom frame rate: Disabled
- Control audio via OBS: Disabled
- Refresh browser when scene becomes active: Optional
- Shutdown source when not visible: Optional (may cause reconnection delay)
Position and resize the caption source in your scene as needed
Custom CSS in OBS
OBS allows applying custom CSS to Browser Sources, enabling styling without modifying the overlay URL:
- In Browser Source properties, expand the "Custom CSS" field
- Enter custom CSS to override default styles (examples below)
Sources: README.md128-146 overlay.html14-55
vMix Integration
vMix integration follows a similar pattern to OBS but with some platform-specific differences.
Adding CAPTION.Ninja to vMix
- In vMix, click "Add Input"
- Select "Browser" from the input types
- Enter the overlay URL from CAPTION.Ninja
- Set Width and Height (1280x720 recommended minimum)
- Click "OK" to add the browser source
- Position the source in your production as needed
Browser Input Settings
- Right-click on the Browser input and select "Browser Settings"
- Ensure "Transparent Background" is checked
- You may need to use Custom CSS similar to OBS for optimal appearance
Sources: README.md38-42
Electron Capture for Desktop Applications
For scenarios where you need to display captions overlaid on desktop applications (not in a stream), CAPTION.Ninja can work with Electron Capture.
- Download Electron Capture from GitHub
- Launch the application
- Enter the overlay URL from CAPTION.Ninja
- Configure the window properties (transparent, click-through, etc.)
- Position the window over the application requiring captions
Sources: README.md44-49
URL Parameters for Streaming Integration
The overlay system accepts various URL parameters that control its behavior. These parameters can be particularly useful when integrating with streaming software:
Parameter | Description | Example |
---|---|---|
room | Required. Specifies the room ID connecting source to overlay | ?room=abc123 |
showtime | Duration (ms) captions remain visible (0 = permanent) | &showtime=5000 |
clear | When present, new captions replace previous ones | &clear |
html | Enables HTML rendering in captions | &html |
translate | Enables translation to specified language code | &translate=es |
Sources: overlay.html609-632 README.md92-99
WebSocket Communication Architecture
The overlay integration relies on WebSocket communication between the caption source and display components. This architecture allows for real-time updates with minimal latency.
The overlay connects to the WebSocket server and implements reconnection logic with exponential backoff to handle connection interruptions.
Sources: overlay.html634-686
Audio Source Configuration for Streaming
CAPTION.Ninja normally uses your system's default microphone for speech recognition. When integrating with streaming software, you may want to caption different audio sources:
Audio Source | Configuration Method |
---|---|
Stream host microphone | Default configuration (no special setup) |
Stream guest audio | Use virtual audio cable to route guest audio to CAPTION.Ninja |
Game audio | Route game audio through virtual audio cable |
Media playback | Route media player audio through virtual audio cable |
For detailed instructions on setting up virtual audio routing, see Advanced Audio Setup.
Sources: README.md52-70
Multi-Language Streaming Setup
For multilingual broadcasts, CAPTION.Ninja allows creating multiple overlay instances from a single caption source:
This configuration:
- Runs a single caption source instance
- Creates multiple browser sources with different translation parameters
- Allows viewers to choose their preferred language stream
Sources: README.md86-108
Troubleshooting Stream Integration
Common issues when integrating CAPTION.Ninja with streaming software:
Problem | Possible Solution |
---|---|
No captions appearing | Verify room IDs match between source and overlay |
Delayed/laggy captions | Check "shutdown source when not visible" is unchecked |
Captions cut off | Increase browser source width/height |
Formatting issues | Check custom CSS is properly formatted |
Connection errors | Ensure network allows WebSocket connections |
Audio not being recognized | Verify correct audio device is selected and active |
For persistent issues, check Troubleshooting for additional guidance.
Sources: overlay.html633-686 README.md224-230
Performance Considerations
When integrating CAPTION.Ninja with streaming software, consider these performance factors:
Browser Source Impact: Each browser source consumes system resources. For multi-language setups, consider using a secondary computer for translation overlays.
Reconnection Handling: The overlay implements automatic reconnection with exponential backoff, which helps recover from network interruptions without manual intervention.
Caption Timing: The
showtime
parameter controls how long captions remain visible. Setting an appropriate value can help with readability without cluttering the screen.Memory Management: For long streaming sessions, consider periodically refreshing the browser source if you notice increased resource usage.
Sources: overlay.html633-686 overlay.html609-632