Commit 26e1e1d
authored
Add video streaming mode to TinyPilot logs (#1666)
Resolves #1490
Video demo:
https://github.com/tiny-pilot/tinypilot/assets/6730025/0165c85d-f9fa-4389-b98d-44de90843f5a
### Notes
1. When there are active WebRTC consumers, I see this in the Janus logs:
```
Oct 30 15:27:57 tinypilot janus[1790]: Creating new session:
3545622190134115; 0xed914e28
Oct 30 15:27:57 tinypilot janus[1790]: Creating new handle in session
3545622190134115: 8464226001965214; 0xed914e28 0xefb019c8
Oct 30 15:27:57 tinypilot janus[1790]: == ustreamer/main -- Creating
session 0xefb01650 ...
Oct 30 15:27:57 tinypilot janus[1790]: == ustreamer/video -- Memsink
opened; reading frames ...
Oct 30 15:27:57 tinypilot janus[1790]: [8464226001965214] Creating ICE
agent (ICE Full mode, controlling)
Oct 30 15:27:57 tinypilot janus[1790]: == ustreamer/audio -- Detected
host audio
Oct 30 15:27:57 tinypilot janus[1790]: == ustreamer/audio -- Pipeline
configured on 48000Hz; capturing ...
Oct 30 15:27:58 tinypilot janus[1790]: [8464226001965214] The DTLS
handshake has been completed
```
When there are no active WebRTC consumers, I see this in the Janus logs:
```
Oct 30 15:30:15 tinypilot janus[1790]: [WSS-0xed9005f8] Destroying
WebSocket client
Oct 30 15:30:15 tinypilot janus[1790]: Destroying session
3545622190134115; 0xed914e28
Oct 30 15:30:15 tinypilot janus[1790]: Detaching handle from ustreamer;
0xefb019c8 0xefb01650 0xefb019c8 (nil)
Oct 30 15:30:15 tinypilot janus[1790]: [8464226001965214] WebRTC
resources freed; 0xefb019c8 0xed914e28
Oct 30 15:30:15 tinypilot janus[1790]: == ustreamer/main -- Removing
session 0xefb01650 ...
Oct 30 15:30:15 tinypilot janus[1790]: == ustreamer/audio -- Pipeline
closed
Oct 30 15:30:15 tinypilot janus[1790]: == ustreamer/video -- Memsink
closed
Oct 30 15:30:16 tinypilot janus[1790]: == ustreamer/video -- No active
watchers, memsink disconnected
```
So based on the above log examples, [H264 mode is
active](https://github.com/tiny-pilot/tinypilot/blob/dda4d8b161eaac91db7f05a4e6bc14510b99f415/debian-pkg/opt/tinypilot-privileged/scripts/collect-debug-logs#L171-L173)
when the last Janus log that contains `ustreamer/video`, also contains
`Memsink opened; reading frames`. For example:
```
Oct 30 15:27:57 tinypilot janus[1790]: == ustreamer/video -- Memsink
opened; reading frames ...
```
Otherwise, it is assumed that MJPEG is active.
<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1666"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>1 parent 959a5a8 commit 26e1e1d
4 files changed
Lines changed: 63 additions & 0 deletions
File tree
- app
- debian-pkg/opt/tinypilot-privileged/scripts
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
52 | 54 | | |
53 | 55 | | |
54 | 56 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
166 | 183 | | |
167 | 184 | | |
168 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
0 commit comments