-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Record Segment Duration increases but incorrect #4188
Comments
Some more information for @aler9 - I just disabled the audio channel on the security camera and it fixed the invalid duration values. I can live with this for now. It would be great to figure out why mediamtx slowly increases durations when the audio channel is enabled. Obviously ffmpeg didn't recognize that audio channel G.711u (mlaw), but VLC does so maybe its an audio codec issue on the machine? |
The same bug happens to me. |
@JoshuaHintze you need to provide some additional data in order to allow to replicate the issue. First of all, in server logs, we need the "[rtsp source] [c->s] DESCRIBE" line (and following lines), since they contain track details and in particular details of the audio track. Second, thing, some seconds of network dump (of the server reading the stream from the camera, WITHOUT any additional reader) would be quite useful. It can be generated in this way:
|
I found out the cause in my promblem. |
@aler9 - I'll try to replicate next week and grab a network log from wireshark. |
Which version are you using?
v1.11.1
Which operating system are you using?
Linux amd64 standard
Describe how to replicate the issue
I have been using the recording feature of mediamtx with a security camera that is generating H.265 video. I'm saving out 5 second recordings into a tmpfs folder. When mediamtx first starts the duration reported by ffprobe is almost exactly 5 seconds. However if I let it sit for a few minutes the REPORTED duration grows but the actual frame count and segment does not. If I let it run for 8 hours the 5 second duration now ways its like 22.43 seconds, and it just keeps growing the longer mediamtx is running. The actual video clip is not 22.43 seconds long, when trying to concat together these files with ffmpeg -concat it does weird things obviously.
Just as an FYI this video camera (RTSP) does not have an audio channel. I saw from this OLD ticket that this issue happened before and it seems it was related to audio channel. (#2477)
Here is an example files after it has ran all night.
2025-01-22_10-02-31-729310.mp4
Here is the ffprobe output of this bad duration file
If I restart mediamtx here is a nice clean expected file
2025-01-22_10-13-36-210014.mp4
Here is the ffprobe of the good clean one
But like I mentioned if it sits for 5 minutes that 5 second duration changes to 5.5 seconds etc.
Here is my relevent mediamtx.yml config
I hope this helps.
Server logs
There is nothing in the server logs that says dropping frames or any particular issues I can see when this is happening.
Here is some of it
Network dump
No response
The text was updated successfully, but these errors were encountered: