-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquick-obs-test.sh
More file actions
executable file
·173 lines (152 loc) · 5.56 KB
/
Copy pathquick-obs-test.sh
File metadata and controls
executable file
·173 lines (152 loc) · 5.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/bash
# Quick automated OBS plugin test
DEVICE_IP="${1:-192.168.110.10}"
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ Quick OBS Plugin Test ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
# 1. Verify plugin
echo "1. Checking plugin installation..."
PLUGIN_SO="$HOME/.config/obs-studio/plugins/streamberry-plugin/bin/64bit/libstreamberry-plugin.so"
if [ -f "$PLUGIN_SO" ]; then
echo " ✅ Plugin file exists"
# Check if it's a valid shared library
if file "$PLUGIN_SO" | grep -q "shared object"; then
echo " ✅ Valid shared library"
else
echo " ❌ Not a valid shared library"
exit 1
fi
# Check dependencies
MISSING=$(ldd "$PLUGIN_SO" 2>&1 | grep "not found" | wc -l)
if [ "$MISSING" -eq 0 ]; then
echo " ✅ All dependencies satisfied"
else
echo " ❌ Missing dependencies:"
ldd "$PLUGIN_SO" | grep "not found"
exit 1
fi
# Check OBS symbols
if nm -D "$PLUGIN_SO" | grep -q "mobile_camera_create"; then
echo " ✅ OBS plugin functions exported"
else
echo " ❌ Missing OBS plugin functions"
exit 1
fi
else
echo " ❌ Plugin not found at: $PLUGIN_SO"
exit 1
fi
echo ""
# 2. Check OBS installation
echo "2. Checking OBS Studio..."
if command -v obs &> /dev/null; then
OBS_VERSION=$(obs --version 2>&1 | head -1 || echo "Unknown")
echo " ✅ OBS Studio found: $OBS_VERSION"
else
echo " ❌ OBS Studio not found"
exit 1
fi
echo ""
# 3. Check Android app
echo "3. Checking Android app..."
if command -v adb &> /dev/null && adb devices | grep -q "device$"; then
if adb shell pidof com.example.streamberry &> /dev/null; then
echo " ✅ Streamberry app is running"
# Get device IP
DETECTED_IP=$(adb shell ip addr show wlan0 2>/dev/null | grep "inet " | awk '{print $2}' | cut -d/ -f1)
if [ -n "$DETECTED_IP" ]; then
echo " ✅ Device IP: $DETECTED_IP"
DEVICE_IP="$DETECTED_IP"
fi
else
echo " ⚠️ App not running, starting..."
adb shell am start -n com.example.streamberry/.MainActivity
sleep 2
fi
else
echo " ⚠️ Cannot verify (no ADB)"
fi
echo ""
# 4. Test stream connectivity
echo "4. Testing stream connectivity..."
if timeout 2 bash -c "echo > /dev/tcp/$DEVICE_IP/8080" 2>/dev/null; then
echo " ✅ WebSocket port accessible ($DEVICE_IP:8080)"
else
echo " ❌ Cannot connect to $DEVICE_IP:8080"
exit 1
fi
# Quick data test
H264_TEST=$(timeout 2 curl -s "http://$DEVICE_IP:8081/stream.h264" 2>&1 | head -c 50 | xxd -p | head -1)
if [ -n "$H264_TEST" ]; then
echo " ✅ HTTP H.264 stream delivering data"
else
echo " ⚠️ HTTP H.264 stream not responding"
fi
echo ""
# 5. Summary
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ PRE-FLIGHT CHECK COMPLETE ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
echo "✅ Plugin: Installed and valid"
echo "✅ OBS: Ready"
echo "✅ Android: Streaming"
echo "✅ Network: Connected"
echo ""
echo "🚀 Ready to test in OBS Studio!"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "MANUAL TEST STEPS:"
echo ""
echo "1. Launch OBS Studio:"
echo " $ obs"
echo ""
echo "2. Add Streamberry source:"
echo " • Sources panel → Click '+'"
echo " • Select 'Streamberry Mobile Camera'"
echo " • Click OK"
echo ""
echo "3. Configure:"
echo " • Connection: Manual IP"
echo " • IP: $DEVICE_IP"
echo " • Protocol: WebSocket"
echo " • Click OK"
echo ""
echo "4. Verify:"
echo " • Video should appear in 2-3 seconds"
echo " • Check for smooth playback"
echo ""
echo "5. Monitor logs (in another terminal):"
echo " $ tail -f ~/.config/obs-studio/logs/*.txt | grep -i streamberry"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
read -p "Press Enter to launch OBS Studio now, or Ctrl+C to exit..."
# Launch OBS
echo ""
echo "🚀 Launching OBS Studio..."
echo ""
# Start log monitoring in background
OBS_LOG_DIR="$HOME/.config/obs-studio/logs"
LATEST_LOG=$(ls -t "$OBS_LOG_DIR"/*.txt 2>/dev/null | head -1)
if [ -n "$LATEST_LOG" ]; then
echo "📊 Monitoring logs: $LATEST_LOG"
echo ""
# Monitor in background
(tail -f "$LATEST_LOG" 2>/dev/null | grep --line-buffered -i "streamberry\|mobile.*camera") &
TAIL_PID=$!
# Launch OBS
obs
# Stop monitoring
kill $TAIL_PID 2>/dev/null
else
obs
fi
echo ""
echo "OBS closed."
echo ""
echo "To view full logs:"
echo " cat $LATEST_LOG | grep -i streamberry"
echo ""