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

FFmpeg memory leaks (until OOM) when got Non-monotonous DTS error #636

Open
okejadi opened this issue Oct 27, 2023 · 2 comments
Open

FFmpeg memory leaks (until OOM) when got Non-monotonous DTS error #636

okejadi opened this issue Oct 27, 2023 · 2 comments
Assignees
Labels
bug Program error or software error or software anomaly. known issue A known issue for which there may be a workaround or which will be fixed in a following version. third-party Configuration from an external program is not necessarily our problem.

Comments

@okejadi
Copy link

okejadi commented Oct 27, 2023

Describe the bug
I have many RTP/UDP multicast sources from a streamer that is pulling Free to Air TV channels from a satellite. Sometimes, one or two channel source got a little bit bad, then from the Process Details log, I got bunch of DTS error like this:

output omitted..
@1697789423 [hls] Non-monotonous DTS in output stream 0:1; previous: 999202502, current: 894696902; changing to 999202503.
output omitted..

The channel's video itself runs fine, but the audio is gone, I hear nothing. FFMpeg memory usage was also fine until this error came and eats a lot of memory that can cause OOM for the container.

I have tried using different fflags like the genpts, igndts, discard_corrupt, etc.. and tried using the use_wallclock_as_timestamps or copyts, or start_at_zero. All of them does nothing to prevent or even to restart the stream. Because the process simply needed to be restarted, and I have done this manually by clicking the disconnect and connect button, that its always working back normal again, until another DTS error came back.

To Reproduce
Steps to reproduce the behavior:

  1. Try to make a stable multicast stream to an unstable multicast stream. e.g lowering the total bitrate than the effective bitrate, or wait for a cloud/storm that the FTA satellite signal may get disturbed or lost (because its free).
  2. Go to each channel and inspect the log inside the process details button
  3. See error

Expected behavior
The ffmpeg / restreamer can automatically restarts the process if DTS error happens so much (sometimes if its only happening a little bit it can corrects by itself)

Screenshots
DTS Error logs
image

One of the ffmpeg process that is starting to eats ram (normally only using 0.3%, and it will spike until OOM kicks out)
image

Additional context
I noticed there are memory_mbytes and the memory_bytes variable inside the Process report log button which is used to set the memory limit and read the current memory usage of the ffmpeg process. Why don't we set it from the GUI, because its a little bit annoying that I need to set limit inside the db.json manually for all of the channel so that it won't eat RAM more than I allowed to. But it is more annoying that sometimes after I set that, it came back to default values '0' (which is unlimited). I would be thankful if we can set the limit in each channel on the GUI, or even set it for all channel

I really want to use this tool because it has bunch of features..
Any suggestions is appreciated, maybe I'm missing something because I just recently used Restreamer with this setup
I can provide additional info if needed, thank you guys..

@okejadi okejadi added the bug Program error or software error or software anomaly. label Oct 27, 2023
@ioppermann
Copy link
Member

This seems to be a bug in ffmpeg itself. With a later version this might get fixed.

Regarding your suggestion for setting the memory and CPU limits for a process, we will put it on our feature request list.

@okejadi
Copy link
Author

okejadi commented Nov 8, 2023

okay thank you.. I really appreciate it!

@svenerbeck svenerbeck added known issue A known issue for which there may be a workaround or which will be fixed in a following version. third-party Configuration from an external program is not necessarily our problem. labels Jan 5, 2024
@svenerbeck svenerbeck removed their assignment Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Program error or software error or software anomaly. known issue A known issue for which there may be a workaround or which will be fixed in a following version. third-party Configuration from an external program is not necessarily our problem.
Projects
None yet
Development

No branches or pull requests

4 participants