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

MediaMTX can't pull RTSP from Majestic running on t31x (while works with ssc378de) #192

Closed
2 tasks done
iGraveD opened this issue Sep 8, 2024 · 15 comments
Closed
2 tasks done
Labels
low priority Not considered without funding rtsp

Comments

@iGraveD
Copy link

iGraveD commented Sep 8, 2024

Required information

  • SoC: t31x
  • OpenIPC version: 2.4.09.08-lite
  • Build: master+88d3b14, 2024-09-07
  • Majestic: master+304fbae, 2024-09-06
  • installation method: Firmware > Update > Install update from GitHub

Issue description

MediaMTX can't pull RTSP from Majestic running on t31x (while can from ssc378de)

Expectations

MediaMTX CAN pull RTSP from Majestic running on t31x.

Steps to reproduce

In mediamtx.yml, set:

paths:
  mystream:
    source: rtsp://root:[password]@[camera IP]:554/stream=0
    sourceAnyPortEnable: yes 

Run mediamtx.

On the same machine, open http://localhost:8888/mystream with your browser.

The browser does not display any video.

When you change the IP address to ssc378de camera in mediamtx.yml and restart mediamtx, the browser starts showing video.

Information to attach

@skilurius
Copy link
Collaborator

Please test the current build: t31.lite.tar

@iGraveD
Copy link
Author

iGraveD commented Sep 10, 2024

Thank you for the updated build. Unfortunately, the test still failed. Please find the attached log file for reference.
mediamtx.log

There were no errors in the Majestic log:

majestic[709]: TCP RTSP SETUP done, stream_id=0 from 192.168.0.2:57642
majestic[709]: RTSP connection closed.
majestic[709]: RTSP chn 0 sps_len 36
majestic[709]: RTSP chn 0 pps_len 3
majestic[709]: RTSP chn 0 profile_level_id 0033e7

It's worth noting that the version number matches today's OpenIPC update, but the executable size (883420) differs from the one included in the OpenIPC update (883332).

Additionally, I’ve observed that the program now requires two parts in the RTMP stream path (e.g., rtmp://ip@myapp/mystream). However, the documentation of at least two media servers—go2rtc and MediaMTX—only specifies the need for a single part, and go2rtc is unable to handle URLs with a two-part path. Would you please consider restoring the ability to stream to URLs with a single-part path?

Thanks again for your efforts, and I look forward to your thoughts.

@skilurius
Copy link
Collaborator

It seems the main problem is located here:

2024/09/10 09:54:32 WAR [path mystream] NALU count exceeds maximum allowed (25)
2024/09/10 09:54:33 WAR [path mystream] NALU count exceeds maximum allowed (25)
2024/09/10 09:54:34 WAR [path mystream] NALU count exceeds maximum allowed (25)
2024/09/10 09:54:36 WAR [path mystream] NALU count exceeds maximum allowed (25)
2024/09/10 09:54:37 WAR [path mystream] NALU count exceeds maximum allowed (25)

https://github.com/bluenviron/mediacommon/blob/main/pkg/codecs/h264/h264.go

@flyrouter
Copy link
Member

@iGraveD
Have you tried specifying a double path reference on your server?
rtmp://youserver:port/mystream/mystream

In fact, the string is used only for unification and then parsing occurs, this does not concern the protocol itself, it is standardized, but the strings are not.

And also read about the standards that should be followed, perhaps there is a hidden app name that is not mandatory, but is mandatory in Majestic.

@skilurius
Copy link
Collaborator

It seems like a restriction enforced by the app, see the following comment: bluenviron/mediamtx#2985 (comment)

@skilurius skilurius closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@flyrouter
Copy link
Member

@MalgathThelamin
Copy link

It seems the main problem is located here

My friend @iGraveD is busy right now, so I will reply in his place.

Thank you for your reply!
How do I change Majestic settings to decrease NALU count per access unit?
Why these changes are not required in another OpenIPC camera with higher resolution?

@MalgathThelamin
Copy link

Have you tried specifying a double path reference on your server?
rtmp://youserver:port/mystream/mystream

Thank you for your reply!

Yes.

@iGraveD wrote, that go2rtc and MediaMTX have 1-part path in their documentations, but only go2rtc was unable to handle 2-part path. Therefore, we have tried MediaMTX with 2-part path.

@MalgathThelamin
Copy link

Also please check this changes https://github.com/bluenviron/mediacommon/pull/120/files

Sorry, I don't understand.

These changes just increase MaxNALUsPerAccessUnit from 21 to 25. But it is already 25 (see the links provided by @skilurius). These changes were submitted on Apr 28, but according to the log file we provided earlier, we use MediaMTX version 1.8.5 which was created in August.

@flyrouter
Copy link
Member

Just use this link as an example and rebuild the applications, increasing NALU to 30 or 50.
And also create a ticket in MediaMTX so that when creating an error message it writes what amount comes for NALU.

@MalgathThelamin
Copy link

MalgathThelamin commented Sep 11, 2024

@flyrouter,

Thank you for your reply!

I increased the value from 25 to 30, 50, 100 and even 500, but it still does not help:

2024/09/11 14:06:36 WAR [path mystream] NALU count exceeds maximum allowed (500)

@MalgathThelamin
Copy link

@skilurius
Is it possible, that the problem is with Majestic, after all?

@skilurius
Copy link
Collaborator

A fix for a different, but potentially connected problem was applied, please test the current build: t31.lite.tar

@MalgathThelamin
Copy link

I confirm that it works in master+ba67249, 2024-09-11
Thank you very much!

@MalgathThelamin
Copy link

MalgathThelamin commented Sep 11, 2024

It also started working with go2rtc, srs, VLC and everything I tested!
Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low priority Not considered without funding rtsp
Projects
None yet
Development

No branches or pull requests

4 participants