Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add streaming modes to TinyPilot logs #1490

Closed
db39 opened this issue Jul 6, 2023 · 0 comments · Fixed by #1666
Closed

Add streaming modes to TinyPilot logs #1490

db39 opened this issue Jul 6, 2023 · 0 comments · Fixed by #1666
Assignees
Labels
enhancement New feature or request medium

Comments

@db39
Copy link
Contributor

db39 commented Jul 6, 2023

It would be useful to see the selected mode and current active streaming modes in TinyPilot logs. We sometimes have to ask users about their streaming mode and whether H.264 has fallen back to MJPEG.

Something like:

Streaming mode
Selected mode: H.264
Current mode: H.264
@db39 db39 added the enhancement New feature or request label Jul 6, 2023
@jdeanwallace jdeanwallace self-assigned this Oct 27, 2023
@mtlynch mtlynch added the medium label Oct 30, 2023
jdeanwallace added a commit that referenced this issue Nov 2, 2023
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants