question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak using Gstreamer pipelines as video input

See original GitHub issue

There is memory leaks issues when using video inputs like:

  • Webcam as a gstreamer pipeline: "v4l2src device=/dev/video0 ! video/x-raw, framerate=30/1, width=640, height=360 ! videoconvert ! appsink"
  • Raspberrypi cam : "nvarguscamerasrc ! video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12 ! nvvidconv ! video/x-raw, format=BGRx, width=640, height=360 ! videoconvert ! video/x-raw, format=BGR ! appsink"

It seems related to OpenCV and VideoCapture API .

Filled two issue on nvidia forum and darknet:

One thing that would be good would be to repro the bug with OpenCV 3.4.7 (latest) and fill an issue on the OpenCV repo.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
tdurandcommented, Mar 6, 2020

Yes you can use htop from terminal

sudo apt-get install htop

htop

It will display the processes and the memory usage, you will have a line with ./uselib blabalbalbala which should be on top and on the left you have the memory usage…

2reactions
tdurandcommented, Mar 6, 2020

Looking for people to test OpenDataCam v3.0.0-alpha.1 on Jetson nano to see if memory leak problem is fixed

Docker setup

Build only available on jetson nano for now.

Should work from jetpack 4.2.x , if not please flash to 4.3

# Remove previous install files or run setup from a new folder

Remove config.json, install-opendatacam.sh, run-docker.sh, run-opendatacam.sh

# Download install script
wget -N https://raw.githubusercontent.com/opendatacam/opendatacam/v3.0.0-alpha.1/docker/install-opendatacam.sh

# Give exec permission
chmod 777 install-opendatacam.sh

# NB: You will be asked for sudo password when installing the docker container

# Install command for Jetson Nano
./install-opendatacam.sh --platform nano

Non-docker setup:

If you want to install without docker (on another platform than jetson nano), follow this documentation:

https://github.com/opendatacam/opendatacam/blob/v3.0.0-alpha.1/documentation/USE_WITHOUT_DOCKER.md

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leaks detected in GStreamer elements (omxh264 or ...
Hi folks. I found omxh264dec or nvvidconv has memory leak problems. The tested pipeline is as follows.
Read more >
Memory Leak in basic Gstreamer pipeline code.
I am trying to run a Gstreamer pipeline code in a loop: The simpler version of my code: Reads the video file and...
Read more >
Memory leak under some conditions when using GST ...
I'm using the following GST Pipeline to process and encode my UYVY Video, which is capture from an ADV7282 over CSI.
Read more >
gStreamer Video Recording Memory Leak - Stack Overflow
I am using following gst command to do recording in MPEG4 Format gst-launch -e rtspsrc location=rtsp://10.17.8.136/mediainput/h264 latency=100 ! decodebin ...
Read more >
Once the Gstreamer applications run for a long time i.e. ...
Once the Gstreamer applications run for a long time i.e. memory consumes 100%. Video saved during this memory run out case is corrupted....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found