Hi,
cuda-10.0,DeepStream4.0 on Jetson Xavier
I using this sample to test cv::VideoWriter with nvv4l2h264enc.And Memory leak problem happens.
void writeMP4File()
{
string videoPath = "./test.mp4";
int frameRate = 6;
Mat bmp = imread ("./test_1.png");
cv::Size frame_size(bmps[0].cols,bmps[0].rows);
std::string gst_writer = "appsrc ! video/x-raw, format=(string)BGR ! \
videoconvert ! video/x-raw, format=(string)I420 ! \
nvvideoconvert ! video/x-raw(memory:NVMM) ! \
nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=" + videoPath;
cv::VideoWriter channelVideoWriter = cv::VideoWriter(gst_writer, cv::VideoWriter::fourcc('a','v','c','1'), frameRate, frame_size, true);
int frame = 0;
while(frame < 40)
{
channelVideoWriter.write(bmp);
frame++;
}
channelVideoWriter.release();
}
If I use VideoWriter without nvv4l2h264enc from deepstream-4.0SDK,Memory leak problem never happens.
string videoPath = "./test.mp4";
cv::VideoWriter channelVideoWriter = cv::VideoWriter(videoPath, cv::VideoWriter::fourcc('a','v','c','1'), frameRate, frame_size, true);
And If I use these VideoWriter,Memory leak obviously.Runing function of writeMP4File 100 times with 2GB memory leak.
std::string gst_writer = "appsrc ! video/x-raw, format=(string)BGR ! \
videoconvert ! video/x-raw, format=(string)I420 ! \
nvvideoconvert ! video/x-raw(memory:NVMM) ! \
nvv4l2h264enc ! h264parse ! matroskamux ! filesink location=" + videoPath;
cv::VideoWriter channelVideoWriter = cv::VideoWriter(gst_writer, cv::VideoWriter::fourcc('a','v','c','1'), frameRate, frame_size, true);
Could you test this and help me?