GStreamer-Python icon indicating copy to clipboard operation
GStreamer-Python copied to clipboard

CPU usage is too high

Open dexception opened this issue 5 years ago • 1 comments

For 1920x1080 resolution.

The CPU is around 2 i7 cores. May the pipeline configured with TCP/UDP connection will yield more efficiency.

dexception avatar Mar 24 '20 09:03 dexception

Do you solve this problem? i try to decode with nvidia accelerate by changing

 self.pipeline = Gst.parse_launch(
            'rtspsrc name=m_rtspsrc ! rtph264depay name=m_rtph264depay ! avdec_h264 name=m_avdech264 ! videoconvert name=m_videoconvert ! videorate name=m_videorate ! appsink name=m_appsink')

to

 self.pipeline = Gst.parse_launch(
            'rtspsrc name=m_rtspsrc ! rtph264depay name=m_rtph264depay ! nvv4l2decoder name=m_avdech264 ! nvvideoconvert name=m_videoconvert ! videorate name=m_videorate ! appsink name=m_appsink')

but there are some error like below:

TypeError: buffer is too small for requested array
Traceback (most recent call last):
  File "/data/vid_streamv3.py", line 78, in new_buffer
    arr = self.gst_to_opencv(sample)
  File "/data/vid_streamv3.py", line 73, in gst_to_opencv
    dtype=np.uint8)
TypeError: buffer is too small for requested array
Caught Keyboard interrupt

ThiagoMateo avatar Apr 06 '21 03:04 ThiagoMateo