https://github.com/Srikanth1511/Glass-Stream
Google Glass XE camera streamer with url
https://github.com/Srikanth1511/Glass-Stream
Last synced: 3 months ago
JSON representation
Google Glass XE camera streamer with url
- Host: GitHub
- URL: https://github.com/Srikanth1511/Glass-Stream
- Owner: Srikanth1511
- Created: 2025-09-21T18:40:21.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-09-21T19:52:41.000Z (4 months ago)
- Last Synced: 2025-09-21T21:28:51.369Z (4 months ago)
- Language: Java
- Size: 9.77 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome - Srikanth1511/Glass-Stream - Google Glass XE camera streamer with url (Java)
README
# Glass XE → PC Minimal MJPEG Stream (and Viewer)
This bundle contains:
- **android-glass-streamer/** — Android (KitKat/API 19) project to run on **Google Glass XE**.
Opens the camera and serves MJPEG at `http://:8080/stream.mjpeg`.
- **MainActivity** shows the actual Glass IP/URL on screen.
- **pc-viewer/** — Python OpenCV viewer that connects to the stream and shows live video.
- **viewer_mediapipe.py** — Python + MediaPipe Hands viewer that overlays hand landmarks.
Run with Glass IP arg in terminal:
```bash
python viewer_mediapipe.py --url http://:8080/stream.mjpeg --stride 2
````
---
## 1) Build & install on Glass (Android Studio)
1. Open **Android Studio** → *Open an existing project* → select `android-glass-streamer`.
2. Let it sync. (Keep `compileSdkVersion`/`targetSdkVersion` at **19**).
3. Connect Glass over ADB (`adb devices` should show it).
4. **Run** the `app` on Glass. (Or build + install manually):
```bash
gradlew assembleDebug
adb install -r app/build/outputs/apk/debug/app-debug.apk
```
### Start/Stop streaming
#### 1) From Glass Interface
* On Glass, launch **GlassStream**.
#### 2) Using cmd on windows from inside android platform tools folder to launch the app
```bash
adb shell am start -W -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.srikanth.glassstream/.MainActivity
```
* Tap **Start Stream** → foreground service starts, streaming MJPEG.
The IP/URL is shown on screen (auto-detected).
* Tap **Stop Stream** → service stops.
---
## 2) View on PC (Python)
```bash
cd pc-viewer
python -m venv .venv
# Windows
.\.venv\Scripts\activate
# Linux/macOS
source .venv/bin/activate
pip install -r requirements.txt
python viewer.py --url http://:8080/stream.mjpeg
```
* Press **ESC** to quit.
---
## 3) Quick sanity check in a browser
On your PC:
```
http://:8080/
```
You should see a simple page with `
` updating.
---
## 4) Find Glass IP
* On Glass: **Settings → Device Info → Status → IP address**
* Or from PC:
```bash
adb shell ip addr show wlan0
```
---
## 5) Debugging FPS & Frames with adb logcat
StreamService logs frame capture/encode counts every \~30–60 frames.
On PC, run:
```bash
adb logcat -s StreamService
```
Typical output:
```
I/StreamService( 2827): Captured frames: 300 (640x480)
I/StreamService( 2827): Encoded JPEGs: 600 (320x240)
```
Use this to compare different preview sizes, JPEG quality, or stride settings.
---
## Notes
* The app uses the **legacy Camera API** + a simple **ServerSocket MJPEG server** (works on API 19).
* Recommended preview size: **640x480** (change in `StreamService.java`).
* Lower JPEG quality (40–50) = higher FPS. Current JPEG quality:60. This can be found in currentJpeg (), line
`yuv.compressToJpeg(new Rect(0, 0, previewW, previewH), 60, baos);`
* Glass and PC must be on the same Wi-Fi; allow port **8080** through firewall.
---
## Which IDE?
* **Android part** → use **Android Studio**
* **Python viewers** → run from terminal; edit in VS Code, PyCharm, etc.