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

Update MediaMTX #1224

Merged
merged 43 commits into from
Jul 22, 2024
Merged

Update MediaMTX #1224

merged 43 commits into from
Jul 22, 2024

Conversation

mrlt8
Copy link
Owner

@mrlt8 mrlt8 commented May 22, 2024

WebUI auth

  • Default wb_password will now be derived from the username part of the Wyze email address instead of using a randomly generated password.
  • Default wb_api will attempt to persist based on wyze account.

MediaMTX

NEW: STREAM_AUTH option to specify multiple users and paths:

  • Username and password should be separated by a :
  • An additional : can be used to specify the allowed IP address for the user.
    • This does NOT work with docker desktop
    • Specify multiple IPs using a comma
  • Use the @ to specify paths accessible to the user.
    • Paths are optional for each user.
    • Multiple paths can be specified by using a comma. If none are provided, the user will have access to all paths/streams
  • Multiple users can be specified by using | as a separator

EXAMPLES:

STREAM_AUTH=user:pass@cam-1,other-cam|second-user:password@just-one-cam|user3:pass
  • user:pass has access to cam-1 and other-cam
  • second-user:password has access to just-one-cam
  • user3:pass has access to all paths/cameras
STREAM_AUTH= user:pass:192.168.0.7|::192.168.0.10|::192.168.0.15,192.168.0.20@just-one-cam
  • user:pass has access to all paths/cameras when streaming from 192.168.0.7
  • No authentication required for all paths/cameras when streaming from 192.168.0.10
  • No authentication required for just-one-cam when streaming from 192.168.0.15 or from 192.168.0.20
STREAM_AUTH=user:pass|:@public-cam|::192.168.0.17
  • user:pass has access to all paths/cameras
  • No authentication required for public-cam
  • No authentication required for all paths/cameras when streaming from 192.168.0.17

Recording via MediaMTX:

RECORD_PATH Available variables are %path or {cam_name}, %Y %m %d %H %M %S %f %s (time in strftime format).

RECORD_LENGTH Length of each clip. Use s for seconds , h for hours. Defaults to 60s
RECORD_KEEP Delete older clips. Use s for seconds , h for hours. Set to 0s to disable automatic deletion. Defaults to 0s

@JA16122000
Copy link

JA16122000 commented Jun 23, 2024

volumes:

  • /mnt/usbhdd/Record/:/record/

Changed '/record/' to '/Record/' and now it is recording ;) [On the 'latest' branche and 'previous build', this won't record at all]
But now i don't get a live stream.
Just an frozen image

HLS Stream is working fine, but WebRTC stream is not working

So:
..............................................................................................................
DEV BUILD:
volumes:

  • /mnt/usbhdd/Record/:/record/ <== wont record.

volumes:

  • /mnt/usbhdd/Record/:/Record/ <== record!

..............................................................................................................
LATEST BUILD:
volumes:

  • /mnt/usbhdd/Record/:/record/ <== record.

volumes:

  • /mnt/usbhdd/Record/:/Record/ <== wont record!

..............................................................................................................

@mrlt8
Copy link
Owner Author

mrlt8 commented Jun 24, 2024

@JA16122000 default settings will record to /record/ , however, if you changed this with RECORD_PATH then you need to mount the location you're recording to.

@JA16122000
Copy link

Unfortunately, the WebRTC stream is not working.

HLS is working, though.

@mrlt8
Copy link
Owner Author

mrlt8 commented Jun 24, 2024

@JA16122000 WebRTC should be fixed with the latest changes. Please let me know if your run into any other issues.

@JA16122000
Copy link

JA16122000 commented Jun 24, 2024

@JA16122000 WebRTC should be fixed with the latest changes. Please let me know if your run into any other issues.

Still not playing with WebRTC

docker-compose.yml looks like:


services:
wyze-bridge:
container_name: wyze-bridge
restart: unless-stopped
image: mrlt8/wyze-bridge:dev
ports:
- 1935:1935 # RTMP
- 8554:8554 # RTSP
- 8888:8888 # HLS
- 5000:5000 # WEB-UI
- 9997:9997 # Expose port for API
- 8889:8889 # WebRTC
- 8189:8189/udp # WebRTC/ICE
environment:
- API_ID=blob
- API_KEY=blob
- WYZE_EMAIL=blob
- WYZE_PASSWORD=blob
- STREAM_AUTH=blob:blob
- WB_AUTH=True
- WB_USERNAME=blob
- WB_PASSWORD=blob
- WB_IP=192.168.178.78
- NET_MODE=LAN
- KEEP_BAD_FRAMES=True
- FRESH_DATA=True
- TZ=Europe/Amsterdam
- RECORD_ALL=True
- RECORD_PATH=/Record/{cam_name}
- RECORD_FILE_NAME={cam_name}%Y%m_%d_%H_%M_%S
- RECORD_LENGTH=1800s
volumes:
- /mnt/usbhdd/Record/:/Record/
- ./tokens:/tokens/


LOG:

🚀 DOCKER-WYZE-BRIDGE v2.9.9 ARMV7L DEV BUILD [2024-06-24t14:25:28.918z] 357857c
[WyzeBridge] ♻️ Clearing local cache...
[WyzeBridge] [MTX] Custom stream auth enabled
[WyzeBridge] [MTX] Auth [blob:blob] paths='all'
[WyzeBridge] 🔍 Could not find local cache for 'auth'
[WyzeBridge] ☁️ Fetching 'auth' from the Wyze API...

  • Serving Flask app 'frontend'
  • Debug mode: off
    [WyzeBridge] WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5000
  • Running on http://172.18.0.2:5000
    [WyzeBridge] Press CTRL+C to quit
    [WyzeBridge] 💾 Saving 'auth' to local cache...
    [WyzeBridge] 🔍 Could not find local cache for 'user'
    [WyzeBridge] ☁️ Fetching 'user' from the Wyze API...
    [WyzeBridge] 💾 Saving 'user' to local cache...
    [WyzeBridge] 🔍 Could not find local cache for 'cameras'
    [WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
    [WyzeBridge] 🔍 Could not find local cache for 'cameras'
    [WyzeBridge] ☁️ Fetching 'cameras' from the Wyze API...
    [WyzeBridge] [API] Fetched [2] cameras
    [WyzeBridge] 💾 Saving 'cameras' to local cache...
    [WyzeBridge] [+] Adding Voortuin [HL_CAM3P]
    [WyzeBridge] [MTX] 📹 Will record 1800s clips to /Record/voortuin/voortuin_%Y_%m_%d_%H_%M_%S.mp4
    [WyzeBridge] [+] Adding Achtertuin [HL_CAM3P]
    [WyzeBridge] [MTX] 📹 Will record 1800s clips to /Record/achtertuin/achtertuin_%Y_%m_%d_%H_%M_%S.mp4
    [WyzeBridge] [API] Fetched [2] cameras
    [WyzeBridge] 💾 Saving 'cameras' to local cache...
    [WyzeBridge] [MTX] starting MediaMTX 1.8.3
    [WyzeBridge] 🎬 2 streams enabled
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET / HTTP/1.1" 200 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/bulma-toast.js HTTP/1.1" 304 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/webrtc.js HTTP/1.1" 304 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/site.js HTTP/1.1" 304 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/bulma.css HTTP/1.1" 200 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/site.css HTTP/1.1" 200 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /static/loading.svg HTTP/1.1" 304 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:21] "GET /api/sse_status HTTP/1.1" 200 -
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:22] "GET /api/sse_status HTTP/1.1" 200 -
    [WyzeBridge] 🎉 Connecting to WyzeCam V3 Pro - Voortuin on 192.168.178.70
    [WyzeBridge] 🎉 Connecting to WyzeCam V3 Pro - Voortuin on 192.168.178.70
    [WyzeBridge] 173.239.217.129 - - [24/Jun/2024 16:45:22] "GET /signaling/voortuin?webrtc HTTP/1.1" 200 -
    [WyzeBridge] 🎉 Connecting to WyzeCam V3 Pro - Voortuin on 192.168.178.70
    [WyzeBridge] 🎉 Connecting to WyzeCam V3 Pro - Achtertuin on 192.168.178.69
    Connection closed by remote. Closing connection.
    Connection closed by remote. Closing connection.
    [voortuin] [-22] IOTC_ER_SESSION_CLOSE_BY_REMOTE

@JA16122000
Copy link

JA16122000 commented Jun 24, 2024

Noticed that MTX auth:

🚀 DOCKER-WYZE-BRIDGE v2.9.9 ARMV7L DEV BUILD [2024-06-24t14:25:28.918z] 357857c
[WyzeBridge] ♻️ Clearing local cache...
[WyzeBridge] [MTX] Custom stream auth enabled
[WyzeBridge] [MTX] Auth [blob:blob] paths='all' <<<=========

I noticed that 'MTX auth' is not case-sensitive for passwords. (I have capital letters, but in the log they are NOT capital)

@mrlt8
Copy link
Owner Author

mrlt8 commented Jun 30, 2024

No changes have been made re: webrtc, so there shouldn't be any difference.

potential work around:

ports:
    - 8189:8189
    - 8189:8189/udp
    ...
environment:
    - MTX_WEBRTCLOCALTCPADDRESS=:8189
    ...

@JA16122000
Copy link

No changes have been made re: webrtc, so there shouldn't be any difference.

potential work around:

ports:
    - 8189:8189
    - 8189:8189/udp
    ...
environment:
    - MTX_WEBRTCLOCALTCPADDRESS=:8189
    ...

So:

ports:
- 8189:8189
- 8189:8189/udp
...
environment:
- MTX_WEBRTCLOCALTCPADDRESS=192.168.178.78:8189

Thats also not working
...

@mrlt8
Copy link
Owner Author

mrlt8 commented Jun 30, 2024

no, should be:

- MTX_WEBRTCLOCALTCPADDRESS=:8189

@JA16122000
Copy link

no, should be:

- MTX_WEBRTCLOCALTCPADDRESS=:8189

Also tried, but doesn't work either

@mrlt8
Copy link
Owner Author

mrlt8 commented Jun 30, 2024

then you should probably open an issue with mediamtx as you seem to be having a different issue.

@JA16122000
Copy link

Where and how do I do that?
I will do that ;)
Can I refer to this topic?

@JA16122000
Copy link

@JA16122000
Copy link

The same as: bluenviron/mediamtx#3522 ??

@mrlt8
Copy link
Owner Author

mrlt8 commented Jul 2, 2024

No, you already confirmed you have a different issue.

Repository owner locked and limited conversation to collaborators Jul 2, 2024
Repository owner unlocked this conversation Jul 10, 2024
@JA16122000
Copy link

i'm excited, works fine!

@mrlt8 mrlt8 merged commit 37e1586 into main Jul 22, 2024
8 checks passed
@mrlt8 mrlt8 deleted the dev branch July 22, 2024 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants