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

Using go2rtc to play recordings [question] #1104

Open
cuervodelviento opened this issue May 10, 2024 · 5 comments
Open

Using go2rtc to play recordings [question] #1104

cuervodelviento opened this issue May 10, 2024 · 5 comments
Labels
question Further information is requested

Comments

@cuervodelviento
Copy link

cuervodelviento commented May 10, 2024

So I have been fiddling a bit with the go2rtc to support playing streams from NVR's that support it, so far I got it to work by adding:

Require: onvif-replay
Range: clock=20240507T203746Z-20240507T203756Z

to the PLAY request

PLAY rtsp://192.168.1.205:565/PlaybackChannel/3/media.smp/ RTSP/1.0
Authorization: Digest username="admin", realm="iPolis", nonce="00000000000000000000000000093D36", uri="rtsp://192.168.1.205:565/PlaybackChannel/3/media.smp/", response="7b2dabc05c1613df4e09ef8a155c3a57"
Session: 32607
Require: onvif-replay
Range: clock=20240507T203746Z-20240507T203756Z
CSeq: 4

I was working on an old version of go2rtc, it was 1.5.0 but the playback was broken (using own go2rtc player).
I updated to 1.9.1 ahd the playback now works on h264 but on h265 is not working, any place I should pay attention to?

(the livestream from the same source works in h265, but I'm assume that there may be any variants)

I also saw something about custom headers, is that for NVRs that supports them (i.e. the clock range is handled by the device and not in the PLAY request) or it can also add headers to the PLAY command?

I can provide Wireshark captures of a playback working with h264 and one stuck on h265 if you are interested on checking it out.

Thanks in advance for any guidance

@AlexxIT AlexxIT added the question Further information is requested label May 10, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented May 10, 2024

I haven't dealt with it. I don't know why it worked before and doesn't work now.

@cuervodelviento
Copy link
Author

the h264 decoding(?) wasn't working on 1.5.0 (h265 wasn't working either)
now in 1.9.1 h264 decoding is working, but h265 still doesn't work, I guess the h264 decoding working now is a byproduct on one enhancement that was done to it, thanks for your reply, this repo is amazing

@AlexxIT
Copy link
Owner

AlexxIT commented May 12, 2024

There have been a lot of changes between these versions.
I don't plan to support non-standard headers like Range anytime soon.
If you have issues with H265 in the regular version of go2rtc, I'm ready to examine the dumps.

@cuervodelviento
Copy link
Author

Disclaimer: I'm aware that is not within the scope of the project and any reply I get is just you going out of your way and don't need to reply but I think that maybe having this discussion here may help others that are using your software to play recordings.

I'm querying an NVR, turns out that the issue is not encoding.

The NVR is replying with several tracks available, some of those tracks don't have any video, I'm trying to play the h265 track that is in fact empty, the h264 is the one that has data, but it wasn't setup, I tried setting it up along with the h265 track but got lost whens setting the trackID.
Now how I'm testing it's from this link, so Chrome sends this->
image
which is correct, basically there is no video on the h265 track so no data to be received.
Edge will send this (h264 support)
image
and I get video.
what I want is to have the play fallback to h264 (or well, to another one of the tracks) the main issue is that PLAY doesn't give any error, but instead doesn't return any data. (ideally, the NVR should reply with 702 when querying for a recording that doesn't exist, but this one does, but not in all tracks).

I was thinking on how should I proceed with this? should I set a certain timeout and then switch the track?

I'm doing my testing from the MSE stream link.
image

@AlexxIT
Copy link
Owner

AlexxIT commented May 18, 2024

go2rtc has no mechanisms that will select a different track if there are problems with the first track.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants