Open vipergts450 opened 1 month ago
I am experiencing the same thing. I reverted back to 2.8.3 which has been solid. I did confirm I have the same issues with 2.9.1 as well.
This doesn't have anything to do with the new FFMPEG option -use_wallclock_as_timestamps
I presume? Could this option cause issues with NVRs? Possibly better config option could be -live_flv
according to the Frigate forums. However, this is possibly also the entirely wrong rabbithole to go down.
Could you try the latest dev build to see if it helps?
@vipergts450 it's a timestamp issue with the raw h264 - the cameras return a timestamp together with the raw h264, but there doesn't seem to be a way to pass that info on to ffmpeg so use_wallclock_as_timestamps seems to help keep everything in sync.
On the dev branch as of this morning. Will report back in a bit.
It's certainly more stable than yesterday, which is a big help. However, something's still going on with the timestamping or keyframing on my Cam v3 (oddly not happening with my very old OG Cam Pan). Do these cams handle the stream keying differently?
2024-05-14T12:00:09.784351760Z [cam1] [video] super slow
2024-05-14T12:00:09.785032712Z [cam1] WARNING: clear buffer
2024-05-14T12:01:54.293497646Z [cam1] WARNING: Audio pipe closed
2024-05-14T12:01:54.994294824Z [WyzeBridge] π Client stopped reading from cam1
2024-05-14T12:01:55.452390762Z [cam1] [Exception] Did not receive a frame for 39s
2024-05-14T12:01:59.528215199Z [WyzeBridge] β '/cam1' stream is down
2024-05-14T12:01:59.528750219Z [WyzeBridge] π Connecting to WyzeCam V3 - Cam1 on 192.168.2.52
2024-05-14T12:02:01.743734438Z [cam1] π‘ Getting 180kb/s HD stream (H264/15fps) via LAN mode (WiFi: 93%) FW: 4.36.11.8391 π
2024-05-14T12:02:01.744719617Z [cam1 π Audio Enabled - ALAW > AAC/16,000Hz
2024-05-14T12:02:01.844483893Z [cam1] WARNING: Skipping wrong frame_size at start of stream [frame_size=1]
2024-05-14T12:02:02.107081553Z [WyzeBridge] β
'/cam1 stream is UP! (3/3)
2024-05-14T12:02:10.485513162Z [WyzeBridge] π New client reading from cam1
Once the stream came back up on its own, it's stable again for the moment. It looks like the stream was up for almost exactly 30 minutes before resetting.
Update: happened again after exactly 30 minutes just as before. So looks like there's a 30 min cycle for resets on the Cam v3 at least, maybe as a counter rolls over? My Cam Pan stream has not reset at all since the container went online.
hmmm, thank you for the data point! I wonder if the camera's might be running some kind of clock sync every 30 minutes that might be throwing off our av sync checks....
Updating again. Since this morning, the Cam V3 has done the 30 min reset consistently, but it's now fast enough that the NVR it's connected to doesn't "notice" the camera going down every single time (only maybe 3 times total all day did it notice the disconnect and send me a warning email) and quickly resumes when it comes back up. The old Cam Pan has never dropped. So the two firmwares seem to do keyframing/timestamping/time sync a bit differently. This current dev version seems to be a reasonable stopgap fix in the interim as compared to 2.9.0-2.9.1 in my opinion until a more permanent fix is discovered.
Update: Stream for the Cam v3 finally went kaput exactly 9 hours, 21min, 25 seconds after starting this morning and did not recover. That's about 33,685 seconds or ~15 min after a signed 16-bit integer counter would roll over past 32768. Not sure if coincidental or related some way how the new FFMPEG counter works. It did not recover again as it had throughout the day and remains permanently down.
2024-05-14T20:31:21.276990825Z [WyzeBridge] β
'/cam1 stream is UP! (3/3)
2024-05-14T20:31:29.356919469Z [WyzeBridge] π New client reading from cam1
2024-05-14T20:50:45.169324471Z [cam1] [video] super slow
2024-05-14T20:50:45.170020970Z [cam1] WARNING: clear buffer
2024-05-14T20:51:24.367778977Z [cam1] [video] super slow
2024-05-14T20:51:51.152894206Z [cam1] [video] super slow
2024-05-14T20:52:14.384863744Z [WyzeBridge] π Client stopped reading from cam1
2024-05-14T20:52:15.210762472Z [cam1] WARNING: Audio pipe closed
2024-05-14T20:52:15.774693428Z [cam1] Stream stopped
That's the log from the last "normal" reset I saw all day until the final stream ended.
The Cam Pan (cam2) has stayed up all day and never had a "blip".
Today's dev release has kept both streams up since starting up 4 hours ago.
I can also confirm that the latest DEV build is solid in regards to the original issue of the thread. I still have zero success with V4 cameras but I don't want to get off topic of this thread.
Unfortunately, it seems like the audio seems to drift behind on the dev branch.
How about trying the live_flv flag?
This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities.
Also, this issue with the 13hr 15min bug I mentioned a few days ago. Maybe I did my math wrong when I said 9 hours?
That thread references using -correct_ts_overflow 0
as an input flag potentially.
https://github.com/bluenviron/mediamtx/issues/622
And later in https://github.com/bluenviron/mediamtx/issues/922
Looks like it was fixed in MediaMTX in 0.18.4?
Thanks @vipergts450, I will have to take a look at those.
I've added the -re
flag for the audio which seems to help keep a stable connection and the audio in sync for a couple of hours now.
Would appreciate any feedback!
I am pulling the dev now as of this writing and will report back.
@vipergts450 Any feedback on the last dev build?
@mrlt8 I have a full day under my belt on this latest dev build and have received no disconnects from the NVRs connected to the stream, and the logs only give the occasional [cam1] [video] super slow
. Cam 2 has never been an issue through all these dev builds (older firmware, older camera). I have not paid attention to the audio delays since I don't make heavy use of that, so unfortunately I am a bad data point for this test for audio sync.
Hello,
I upgraded to 2.9.0 yesterday and suddenly the connections from the bridge to my two cameras is very unstable. The log has these messages every couple of seconds. I have
ON_DEMAND=False
set in my config but that did not help. Nothing about my configuration changed since the prior version which had been rock solid.Possible related to this person's issue: https://github.com/mrlt8/docker-wyze-bridge/issues/1186#issuecomment-2106408697
Could this be a port mapping issue that arose with the latest update? I don't see any log lines that suggest the bridge is losing the feed from the cameras, but seemingly clients connecting externally to the bridge to retrieve the feeds have this constant connect/disconnect problem.
The choppy stream, timeout when fetching snapshot on the WebUI (the auto refresh sometimes pulls a new snapshot image and sometimes does not for 15-20min), and general misbehavior seems to point to something between the front-end and the mediamtx backend, but I can't seem to figure out what exactly.