-
Notifications
You must be signed in to change notification settings - Fork 547
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
Regular short skips and occasional long skips (RTMP) #1224
Comments
We would need to see the log (at level 7 or higher) and also do a deep dive into the resulting the frames of the mp4. The log will show the size of the memory block is being created to hold the packets. This can then be compared against the frames in the video to see if there is any correlation. The presentation timestamps (PTS) of the video can also be inspected using ffprobe to determine whether there were actual frames missed or whether it is a problem with the timestamps. As you would expect, there is not much processing going on in these steps so I'm not sure what could be causing it. My system runs many cameras like this without skips...Have you checked whether memory is maxed out? Is CPU maxed or spike? You could also use ffplay and/or ffprobe directly against the high resolution streams and see if any unusual messages are reported. |
Happy to provide the logs - motion-level-7.log.gz. Camera id 102 (10.0.11.11) is the camera I used in this test. Camera 101(10.0.11.10) is offline for the purpose of this test. In this log I see the skips (& short freezes), I did not observe the skip of multiple seconds (it's less frequent) Re Result of ffprobe
ffplay -nodisp:
|
Couple of additional things. We'd need to see an actual log that corresponds to when the issue occurs. Having the camera disconnected means the log isn't of value. The resulting video associated with the log demonstrating the issue would also be needed. You may also want to check the frame rates by executing a ffprobe on the low resolution stream of the camera. Make sure it is also at 30 fps like the high resolution stream. Try setting the high resolution stream at a lower resolution and see if the issue still exists. |
To clarify. I have two cameras. I unplugged one and left only one plugged in (in hindsight, I should've just removed config for the first one - I will repeat that tonight). The camera that was left plugged in (102) did demonstrate the issue and the logs are captured at the time of the issue (or shortly after).
This will be difficult. My camera does not allow me to set it to high framerate (4, 7, 10, 15), and the maximum bitrate for low resolution stream is 512kbps. I can lower the high resolution framerate, and maybe the 15fps would be sufficient... But I am not sure how good the low resolution stream will be at 15 fps. Can you clarify why setting the same framerate would potentially help? Also, I am considering, as a workaround, using |
Skips/freezes are still happening. In addition, I added the following script to on_event_start
on_event_end
Observations
I am going to continue running my modified script to monitor for the long jumps (e.g. where there is a jump in frames that skips 5 seconds on video). This is the level-7 log: Videos available upon request in private. I have not tried putting the low-resolution stream and high-resolution stream at the same FPS. I am not sure how this is relevant - ideally I want to keep low resolution stream at low fps (e.g. 4 or 7), just to match motion's detection fps (which I believe is set to something like 3 fps by default?) |
Seems like you have a workaround and I am unable to replicate or diagnose from here so I am closing issue. In addition to the other things I suggested, I noticed in the log that a mount is being used for the target_dir. If that is slow it would affect the capture/writing. Motion alternates on the same thread between reading and writing so delays in the writing would affect the capture rate. |
Thanks mr-dave. My /mnt contains a raid+1 always on spinning drive that don't do anything else but record the video. They have plenty of bandwidth, and this shouldn't be an issue. The workaround is not ideal -- it feels like the recording is starting too late (I am under the impression that motion has some buffer before the motion is detected? or is this not the case?) I would be happy to provide whatever data is needed to figure it out. I have run the following command
and observed following entries:
(I have observed these entries with cameras from two different manufacturers, so I am assuming that's normal, though disappointing). I have also observed
The RTSP stream looks worse, but I am using RTMP in motion
and
and
Let me know if you've seen any of these. The missing packets are worrying, and frankly sound impossible. Both camera and the computer are hardwired, the camera has a dedicated network cable, and the computer has a 10gb connection to the switch, and the switch is not reporting any collisions. |
Problem
I am noticing occasional, frequent frame skips (it looks like 1-2 skipped frames or freeze, hard to say every 1-2 seconds), when the video is dumped in a passthrough mode. The same skips are not visible when using VLC to access the stream.
Sometimes, the recording will skip multiple seconds (e.g. jump suddenly by 5 seconds). Recorded video available upon request.
Configuration
Camera model: Reolink RLC-410
Firmware: latest ( v3.0.0.65_20071000
The computer and the cameras are hardwired, with 1gbps link.
Given that the skips/freezes are not happening in VLC, I am wondering if this is a configuration issue or a bug.
I also tried using rtmpdump with the same urls, and there are no freezes when the stream is captured using that tool.
Any help appreciated, thank you.
The text was updated successfully, but these errors were encountered: