Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Raspberry pi 3B+, QMultimedia problem with playing 4 streams



  • Hi
    I have written a simple application for Raspberry Pi B3+ using QT and QMultimediaPlayer that plays 4 video streams from my DVR.
    DVR is streaming using RTSP protocol.

    When I am playing one stream from DVR - all is working.

    But when I am splitting screen to 4 sections and try to play 4 streams, only two streams are working and other 2 are not working with error: Error: "Failed to allocate required memory."

    Debugging the gstreamer gives me an information:

    :00:04.703047371  5282 0x71d0e830 ERROR          v4l2allocator gstv4l2allocator.c:735:gst_v4l2_allocator_start:<v4l2video10dec2:pool:src:allocator> error requesting 2 buffers: Cannot allocate memory
    0:00:04.704960493  5282 0x71d0e830 ERROR         v4l2bufferpool gstv4l2bufferpool.c:848:gst_v4l2_buffer_pool_start:<v4l2video10dec2:pool:src> we received 0 buffer from device '/dev/video10', we want at least 2
    0:00:04.706402314  5282 0x71d0e830 ERROR             bufferpool gstbufferpool.c:560:gst_buffer_pool_set_active:<v4l2video10dec2:pool:src> start failed
    0:00:04.707866635  5282 0x71d0e830 ERROR          v4l2allocator gstv4l2allocator.c:735:gst_v4l2_allocator_start:<v4l2video10dec2:pool:src:allocator> error requesting 2 buffers: Cannot allocate memory
    0:00:04.708705852  5282 0x71d0e830 ERROR         v4l2bufferpool gstv4l2bufferpool.c:848:gst_v4l2_buffer_pool_start:<v4l2video10dec2:pool:src> we received 0 buffer from device '/dev/video10', we want at least 2
    0:00:04.709375382  5282 0x71d0e830 ERROR             bufferpool gstbufferpool.c:560:gst_buffer_pool_set_active:<v4l2video10dec2:pool:src> start failed
    0:00:04.709964548  5282 0x71d0e830 WARN            v4l2videodec gstv4l2videodec.c:710:gst_v4l2_video_dec_handle_frame:<v4l2video10dec2> error: Failed to allocate required memory.
    0:00:04.711061682  5282 0x71d0e830 WARN            v4l2videodec gstv4l2videodec.c:710:gst_v4l2_video_dec_handle_frame:<v4l2video10dec2> error: Buffer pool activation failed
    0:00:04.737854973  5282 0x6f705460 WARN                 basesrc gstbasesrc.c:2950:gst_base_src_loop:<udpsrc3> error: Internal data stream error.
    0:00:04.738086484  5282 0x6f705460 WARN                 basesrc gstbasesrc.c:2950:gst_base_src_loop:<udpsrc3> error: streaming stopped, reason error (-5)
    0:00:04.757184891  5282 0x71d0e920 WARN                 basesrc gstbasesrc.c:2950:gst_base_src_loop:<udpsrc0> error: Internal data stream error.
    0:00:04.759430252  5282 0x71d0e920 WARN                 basesrc gstbasesrc.c:2950:gst_base_src_loop:<udpsrc0> error: streaming stopped, reason error (-5)
    
    

    Sourcecode of the application is here: https://github.com/krzychk2/kdess
    Using the same code in PC - works.
    Dear community, can You help me solve my problem?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    The RPi does not have a lot of memory and video decoding is not cheap, so basically you are exhausting the available memory.

    What kind of video are you playing ?



  • Hi
    Thank You for Your answer and sorry for the late answer.

    I am trying to play 4 streams from Dahua DVR H264 MPEG-4 AVC streams using rtsp, resolution is 352x288

    What memory I am consiming? because I have made some statistics and I can see a lot of free ram memory. Also I have tryied to run some statistics and I can see that my app has consumed 380 megs of virtual memory and 45 megs of resident memory. I have turned on zRAM and it is not using any zRAM pages.

    Moving from Raspi 3b+ to Raspi 4 with 4GB may help?


Log in to reply