Skip to content

StreamBerryLabs/StreamBerry-Cam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StreamBerry-Cam Logo

📱 StreamBerry-Cam

Transform Your Android Device Into a Professional Wireless Camera

Version License: GPL v2 Android Kotlin

StreamBerry-Cam turns your Android device into a professional wireless camera for OBS Studio with ultra-low latency streaming, multiple protocol support, and advanced camera controls.

🚀 Quick Start📦 Download📖 Documentation🔌 OBS Plugin🐛 Report Bug


✨ Features

🎯 Feature 📝 Description
🎥 Professional Camera Controls Manual ISO, shutter speed, focus, white balance, and zoom
🚀 Ultra-Low Latency 50-150ms latency with WebSocket protocol
🎭 5 Streaming Protocols WebSocket, HTTP H.264, MJPEG, RTSP, MPEG-DASH
📺 4K Support Stream up to 4K (3840x2160) @ 30fps
🎨 Real-time Filters Cartoon, Sketch, Vintage, Oil Painting effects
🌈 LUT Support Load custom color grading LUTs
🎬 HDR Streaming High Dynamic Range video capture
🎯 AI Face Tracking Automatic focus tracking with ML Kit
🔍 Auto-Discovery mDNS service for automatic device discovery
📱 Multi-Camera Switch between front/back cameras on-the-fly
Hardware Encoding H.264 hardware acceleration with MediaCodec
🎚️ Camera Presets Save and load custom camera settings
🌐 Multi-Protocol Server All protocols running simultaneously
🆓 100% Free & Open Source No subscriptions, no ads, forever free

📋 Supported Streaming Protocols

🎭 Protocol 🔌 Port ⚡ Latency 🎯 Best For 🌐 Quality
⚡ WebSocket (OBS Droid) 8080 50-150ms Live streaming, gaming, real-time ⭐⭐⭐⭐⭐
🎬 HTTP H.264 8081 100-300ms Recording, high quality, 4K ⭐⭐⭐⭐⭐
📸 MJPEG 8081 200-500ms Maximum compatibility ⭐⭐⭐⭐
📹 RTSP 8554 150-400ms Professional workflows, lossless 4K ⭐⭐⭐⭐⭐
🌊 MPEG-DASH 8081 300-1000ms Adaptive bitrate streaming ⭐⭐⭐⭐

💡 Pro Tip: Use WebSocket for lowest latency, RTSP for professional lossless 4K streaming


📦 Installation

📱 Download APK

Option 1: GitHub Releases (Recommended)

# Download latest release
https://github.com/StreamBerryLabs/StreamBerry-Cam/releases/latest

Option 2: Build from Source

# Clone repository
git clone https://github.com/StreamBerryLabs/StreamBerry-Cam.git
cd StreamBerry-Cam/android

# Build debug APK
./gradlew assembleDebug

# Build release APK
./gradlew assembleRelease

# APK location:
# Debug: android/app/build/outputs/apk/debug/app-debug.apk
# Release: android/app/build/outputs/apk/release/app-release.apk

📋 Requirements

  • Android Version: 7.0 (Nougat) or higher (API 26+)
  • RAM: 2GB minimum, 4GB+ recommended for 4K
  • Storage: 100MB free space
  • Camera: Hardware H.264 encoder recommended
  • Network: WiFi or mobile hotspot

🚀 Quick Start

🎬 Get Streaming in 3 Easy Steps!

1️⃣ Install the App

Download and install StreamBerry-Cam APK on your Android device.

2️⃣ Grant Permissions

Allow camera, microphone, and network permissions when prompted.

3️⃣ Start Streaming

  1. 📱 Open StreamBerry-Cam
  2. 🌐 Connect to WiFi (same network as your computer)
  3. 🎥 Tap "Start Streaming"
  4. 📋 Note your device IP (displayed on screen)
  5. 🖥️ Open OBS Studio with BerryStreamCam Plugin
  6. ✅ Add Source → Select your device → Start streaming!

🎛️ Features Guide

📷 Professional Camera Controls

Manual Controls:

  • ISO: 100-3200 (device dependent)
  • Shutter Speed: 1/8000s to 1s
  • Focus: Auto, Manual, Continuous, Macro
  • White Balance: Auto, Manual, Daylight, Cloudy, Tungsten, Fluorescent
  • Zoom: 1x to 10x digital zoom
  • Flash: Off, On, Auto, Torch

Advanced Features:

  • HDR Mode: High Dynamic Range capture
  • OIS/EIS: Optical and Electronic Image Stabilization
  • Exposure Compensation: -3 to +3 EV
  • Focus Tracking: AI-powered face detection and tracking

🎨 Real-time Filters

Apply stunning visual effects in real-time:

  • 🎭 Cartoon Filter: Comic book style effect
  • ✏️ Sketch Filter: Pencil drawing effect
  • 📷 Vintage Filter: Retro film look
  • 🖼️ Oil Painting Filter: Artistic painting effect
  • 🌈 LUT Support: Load custom .cube LUT files

Filter Controls:

  • Adjustable intensity (0-100%)
  • Real-time preview
  • Save filter preferences
  • Combine with camera settings

🎬 Streaming Quality Presets

Choose the perfect quality for your needs:

Preset Resolution FPS Bitrate Use Case
1080p30 1920x1080 30 6 Mbps Default, balanced quality
720p60 1280x720 60 8 Mbps Smooth motion, gaming
1080p60 1920x1080 60 12 Mbps Professional quality
4K30 3840x2160 30 25 Mbps Ultra HD, recording

📱 Multi-Camera Support

  • Front/Back Camera: Switch seamlessly during streaming
  • External Cameras: Support for USB cameras (OTG)
  • Camera Switching: Hot-swap without disconnecting

🔧 Network Configuration

Connection Info:

  • Device IP: Automatically displayed
  • WebSocket: ws://[IP]:8080/stream
  • HTTP H.264: http://[IP]:8081/stream.h264
  • MJPEG: http://[IP]:8081/mjpeg
  • RTSP: rtsp://[IP]:8554/stream
  • DASH: http://[IP]:8081/dash/manifest.mpd
  • Web Player: http://[IP]:8081/

mDNS Service:

  • Service Name: Streamberry-[IP]
  • Service Type: _streamberry._tcp.local
  • Auto-discovery enabled

🏗️ Architecture

System Overview

┌─────────────────────────────────────────────────────────────┐
│                  StreamBerry-Cam Android App                 │
│                                                               │
│  ┌───────────────────────────────────────────────────────┐  │
│  │              Camera Pipeline                           │  │
│  │                                                         │  │
│  │  Camera2 API → Image Processing → H.264 Encoder       │  │
│  │       ↓              ↓                  ↓              │  │
│  │   Manual       Filters/LUT         MediaCodec         │  │
│  │   Controls     Effects             Hardware           │  │
│  └───────────────────────────────────────────────────────┘  │
│                           │                                  │
│  ┌────────────────────────▼──────────────────────────────┐  │
│  │           Streaming Pipeline                          │  │
│  │                                                        │  │
│  │  - Frame distribution                                 │  │
│  │  - Protocol multiplexing                              │  │
│  │  - SPS/PPS extraction                                 │  │
│  │  - Format conversion (Annex-B)                        │  │
│  └────────────────────────────────────────────────────────┘  │
│                           │                                  │
│  ┌────────────────────────▼──────────────────────────────┐  │
│  │              Multi-Protocol Servers                   │  │
│  │                                                        │  │
│  │  ┌──────────┐  ┌──────────┐  ┌──────────────────┐   │  │
│  │  │WebSocket │  │   RTSP   │  │   HTTP Server    │   │  │
│  │  │  Server  │  │  Server  │  │  - DASH          │   │  │
│  │  │          │  │          │  │  - MJPEG         │   │  │
│  │  │Port 8080 │  │Port 8554 │  │  - Raw H.264     │   │  │
│  │  └──────────┘  └──────────┘  │  - Web Player    │   │  │
│  │                               │  Port 8081       │   │  │
│  │                               └──────────────────┘   │  │
│  └────────────────────────────────────────────────────────┘  │
│                           │                                  │
│  ┌────────────────────────▼──────────────────────────────┐  │
│  │              mDNS Service                             │  │
│  │                                                        │  │
│  │  - Auto-discovery broadcasting                        │  │
│  │  - Service registration                               │  │
│  └────────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘
                           │
                      WiFi Network
                           │
┌─────────────────────────────────────────────────────────────┐
│                    OBS Studio (Desktop)                      │
│                                                               │
│  ┌───────────────────────────────────────────────────────┐  │
│  │         BerryStreamCam OBS Plugin                      │  │
│  │                                                         │  │
│  │  - Auto-discovery                                      │  │
│  │  - Protocol selection                                  │  │
│  │  - H.264 decoding                                      │  │
│  │  - GPU rendering                                       │  │
│  └───────────────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────────────────┘

Tech Stack

Core Technologies:

  • Kotlin - Modern Android development
  • Jetpack Compose - Declarative UI framework
  • Camera2 API - Advanced camera controls
  • MediaCodec - Hardware H.264 encoding
  • Ktor - Async HTTP/WebSocket servers
  • Coroutines - Async/concurrent programming
  • Koin - Dependency injection

Key Libraries:

  • ML Kit - Face detection and tracking
  • TensorFlow Lite - AI/ML processing
  • Room - Local database
  • DataStore - Preferences storage
  • Timber - Logging framework

🎯 Performance Tips

For Lowest Latency (50-150ms):

✅ Use WebSocket protocol
✅ 720p @ 30fps
✅ 5GHz WiFi
✅ Close to router
✅ Disable filters and effects

For Best Quality:

✅ Use HTTP H.264 or RTSP protocol
✅ 1080p @ 60fps or 4K @ 30fps
✅ Wired ethernet on PC
✅ 5GHz WiFi for phone
✅ Hardware encoding enabled

For 4K Streaming:

✅ Use RTSP or HTTP H.264 protocol
✅ 4K (3840x2160) @ 30fps
✅ Gigabit ethernet (recommended)
✅ High-end device (Snapdragon 8 Gen 2+)
✅ 20-30 Mbps bandwidth
✅ Hardware decoding on PC

Battery Optimization:

✅ Keep device plugged in during streaming
✅ Lower resolution/framerate
✅ Disable unnecessary features
✅ Use airplane mode + WiFi only
✅ Reduce screen brightness


🛠️ Development

Building from Source

Prerequisites:

  • Android Studio Hedgehog (2023.1.1) or later
  • JDK 17
  • Android SDK 34
  • Kotlin 1.9.20

Build Steps:

# Clone repository
git clone https://github.com/StreamBerryLabs/StreamBerry-Cam.git
cd StreamBerry-Cam

# Open in Android Studio
# File → Open → Select 'android' folder

# Or build via command line
cd android
./gradlew assembleDebug

# Install on connected device
./gradlew installDebug

Project Structure

StreamBerry-Cam/
├── android/
│   ├── app/
│   │   ├── src/main/kotlin/com/example/streamberry/
│   │   │   ├── MainActivity.kt
│   │   │   ├── StreamberryApplication.kt
│   │   │   ├── camera/
│   │   │   │   ├── CameraManager.kt
│   │   │   │   ├── DeviceCapabilities.kt
│   │   │   │   └── CameraPresetStorage.kt
│   │   │   ├── streaming/
│   │   │   │   ├── StreamingManager.kt
│   │   │   │   ├── StreamingPipeline.kt
│   │   │   │   ├── ObsDroidServer.kt
│   │   │   │   ├── http/HttpServer.kt
│   │   │   │   └── rtsp/RtspServer.kt
│   │   │   ├── video/
│   │   │   │   ├── VideoEncoder.kt
│   │   │   │   └── H264FormatConverter.kt
│   │   │   ├── audio/
│   │   │   │   └── AudioProcessingPipeline.kt
│   │   │   ├── effects/
│   │   │   │   ├── CartoonFilterEffect.kt
│   │   │   │   ├── SketchFilterEffect.kt
│   │   │   │   ├── VintageFilterEffect.kt
│   │   │   │   ├── OilPaintingFilterEffect.kt
│   │   │   │   └── LUTEffect.kt
│   │   │   ├── ai/
│   │   │   │   └── FaceDetector.kt
│   │   │   ├── network/
│   │   │   │   └── MdnsService.kt
│   │   │   ├── ui/
│   │   │   │   ├── screens/
│   │   │   │   ├── viewmodels/
│   │   │   │   └── theme/
│   │   │   └── di/
│   │   │       └── AppModule.kt
│   │   └── build.gradle.kts
│   └── build.gradle.kts
└── README.md

Running Tests

# Unit tests
./gradlew test

# Instrumented tests
./gradlew connectedAndroidTest

# Lint checks
./gradlew lint

🔧 Troubleshooting

App Crashes on Startup
  • ✅ Grant all required permissions
  • ✅ Check Android version (7.0+)
  • ✅ Clear app data and cache
  • ✅ Reinstall the app
  • ✅ Check device logs: adb logcat | grep Streamberry
🌐 Cannot Connect from OBS
  • ✅ Both devices on same WiFi network
  • ✅ Check firewall settings
  • ✅ Verify IP address is correct
  • ✅ Try manual IP entry in OBS plugin
  • ✅ Restart WiFi router
  • ✅ Disable VPN on both devices
🎥 No Video Stream
  • ✅ Camera permission granted
  • ✅ Check "Start Streaming" is enabled
  • ✅ Try different protocol
  • ✅ Restart the app
  • ✅ Check device supports H.264 encoding
  • ✅ Lower resolution/framerate
High Latency
  • ✅ Switch to WebSocket protocol
  • ✅ Use 5GHz WiFi
  • ✅ Reduce resolution to 720p
  • ✅ Move closer to router
  • ✅ Close other apps
  • ✅ Disable filters and effects
🔋 Battery Drains Quickly
  • ✅ Keep device plugged in
  • ✅ Lower resolution/framerate
  • ✅ Reduce screen brightness
  • ✅ Disable unnecessary features
  • ✅ Use airplane mode + WiFi

📚 API Documentation

Streaming Endpoints

WebSocket (OBS Droid Protocol):

ws://[DEVICE_IP]:8080/stream
ws://[DEVICE_IP]:8080/health

HTTP Endpoints:

http://[DEVICE_IP]:8081/stream.h264    # Raw H.264 stream
http://[DEVICE_IP]:8081/mjpeg          # MJPEG stream
http://[DEVICE_IP]:8081/dash/manifest.mpd  # MPEG-DASH
http://[DEVICE_IP]:8081/                   # Web player

RTSP:

rtsp://[DEVICE_IP]:8554/stream

WebSocket Protocol

Message Format:

{
  "type": "video_frame",
  "pts": 123456789,
  "dts": 123456789,
  "keyframe": true,
  "codec": "h264",
  "data": "base64_encoded_h264_data"
}

Audio Frame:

{
  "type": "audio_frame",
  "pts": 123456789,
  "codec": "aac",
  "samples": 1024,
  "data": "base64_encoded_aac_data"
}

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Development Guidelines

  • Follow Kotlin coding conventions
  • Use Jetpack Compose for UI
  • Add KDoc comments for public APIs
  • Write unit tests for new features
  • Test on multiple Android versions
  • Update README for new features

🔮 Roadmap

Version 1.1.0 (Planned)

  • Audio Streaming

    • Microphone audio capture
    • Audio sync with video
    • Multiple audio sources
  • Enhanced Discovery

    • QR code pairing
    • Bluetooth LE discovery
    • USB connection (ADB)
  • Advanced Camera

    • RAW image capture
    • Burst mode
    • Time-lapse recording

Version 1.2.0 (Future)

  • Cloud Features

    • Remote access over internet
    • Cloud recording
    • Multi-device sync
  • Professional Tools

    • Waveform monitor
    • Vectorscope
    • False color
    • Zebra stripes

📊 Performance Benchmarks

Latency Comparison

Protocol Average Latency Jitter Packet Loss
WebSocket 75ms ±25ms <0.1%
HTTP H.264 180ms ±50ms <0.5%
RTSP 220ms ±60ms <0.3%
MJPEG 350ms ±100ms <1.0%

Resource Usage (1080p30)

Metric Value
CPU Usage 15-25%
RAM Usage 200-400 MB
Battery Drain ~20%/hour
Network 6-8 Mbps
Storage 100 MB

📄 License

This project is licensed under the GNU General Public License v2.0 - see the LICENSE file for details.

🙏 Credits

📞 Support


💖 Made with Love & Code

Swadhin Biswas
Swadhin Biswas

💻 🎨 📖 🤔

Creator & Lead Developer

GitHub Twitter LinkedIn Portfolio


⭐ Show Your Support

If you found StreamBerry-Cam useful, please consider:

Star on GitHub Fork on GitHub Watch on GitHub

⭐ Star this repo🍴 Fork it📢 Share with others


Built with 📱 Android • 🎥 Camera2 API • ⚡ Real-time Streaming • 🔐 Open Source Spirit

© 2025 Swadhin Biswas. Licensed under GPL-2.0

⬆ Back to top