Using Gstreamer overlay feature on multiple core

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Using Gstreamer overlay feature on multiple core

naman thaker
Hello,

I am using gstreamer pipeline on i.MX8M Mini dual core platform to capture a 5MP@20FPS camera input and put overlay on it using below command:
gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,width=2592,height=1944  ! queue ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080  ! textoverlay  text="Device name[%STATUS] reading : %%%" valignment=top halignment=left shaded-background=true ! textoverlay text="Device %Serial Number : ..%Tag location.." valignment=bottom halignment=left shaded-background=true  ! clockoverlay halignment=right valignment=top shaded-background=true time-format="%H:%M:%S %D" ! vpuenc_h264 ! h264parse ! mp4mux ! filesink location=/home/root/video.mp4

Here is the image of expected output:


When I use the above command, CPU utilisation increases to 120% (checked with top command) and the video is recorded at 6FPS.

The camera input is actually 20FPS and I get full 20FPS when I remove the overlay pipeline as below:
gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=100 ! video/x-raw,width=2592,height=1944  ! queue ! imxvideoconvert_g2d ! video/x-raw,width=1920,height=1080  ! vpuenc_h264 ! h264parse ! mp4mux ! filesink location=/home/root/video.mp4

I suspect the overlay pipeline is completely utilising the CPU core due to which the FPS is dropping.

How can I make the overlay pipeline to use multiple cores of the CPU so that I can get full FPS while recording ? Is there any other method to optimise the overlay pipeline to reduce CPU utilisation and increase FPS?

Regards,
Naman