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

FFmpegFrameGrabber videocapture require memory increase #2249

Open
hexianbin1994 opened this issue Jul 8, 2024 · 1 comment
Open

FFmpegFrameGrabber videocapture require memory increase #2249

hexianbin1994 opened this issue Jul 8, 2024 · 1 comment

Comments

@hexianbin1994
Copy link

hexianbin1994 commented Jul 8, 2024

when I use FFmpegFrameGrabber to capture from rtsp video, I notice the memory will be increase soon, it looks unnormal.

os: windows
jdk:1.8
javacv:1.5.11-SNAPSHOT

package com.example.demo.server;

import lombok.extern.slf4j.Slf4j;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import com.carrotsearch.sizeof.RamUsageEstimator;

@Slf4j
class demo1 {
    public static void main() throws FFmpegFrameGrabber.Exception {
        for (int i=0;i<100;i++){
        FFmpegFrameGrabber grabber;
        grabber = new FFmpegFrameGrabber("rtsp://128.8.84.224:18554/stream");
        try {
            grabber.start();
        } catch (FFmpegFrameGrabber.Exception e) {
            e.printStackTrace();
        }

        long size1 = RamUsageEstimator.sizeOf(grabber);
        log.info("#### start state grabber cost "+size1+" bytes");

        grabber.stop();
        grabber.release();
        }
    }
}

the memory will keep increasing

@saudet
Copy link
Member

saudet commented Jul 8, 2024

Please try again with the snapshots: http://bytedeco.org/builds/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants