Imx8 GStreamer zooms and displays the camera image

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Imx8 GStreamer zooms and displays the camera image

522 Views
songhongliang
Contributor II

My camera has a resolution of 1280x720, and my LCD has a resolution of 1280x720, but I only want to display the whole camera image in some areas of the LCD. Can you give me some gst-launch-1.0 commands for my reference.

0 Kudos
Reply
3 Replies

71 Views
malik_cisse
Senior Contributor I

The way I do hardware accelerated zooming is to use imxvideoconvert_g2d like this:
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=1280,height=800 ! videocrop top=0 left=120 right=120 bottom=0 ! imxvideoconvert_g2d rotation=3 ! video/x-raw, width=480, height=800 ! waylandsink 
Note that "videocrop" settings is a metadata that gets passed to imxvideoconvert_g2d as parameter.
This works also dynamically if you use the C gst api.
PS: One should avoid "videoconvert" as it is software based and not GPU accelerated.

0 Kudos
Reply

511 Views
joanxie
NXP TechSupport
NXP TechSupport

try the command like this

"# gst-launch-1.0 imxcompositor_g2d name=comp sink_0::xpos=xx sink_0::ypos=xx ! waylandsink videotestsrc ! video/x-raw, width=640, height=480 ! comp.sink_0"

xx is the position you want to set

0 Kudos
Reply

83 Views
EnochXu
Contributor II

this cmd is worked, but my video plays with a mosaic and the width is exactly the size of the xpos offset I set,

I use IMX8MP ,cmd as following "gst-launch-1.0 compositor name=comp sink_0::xpos=320 sink_0::ypos=0 ! glimagesink filesrc location=/run/media/mmcblk1p1/DCIM/VID_20210713_214846.avi ! decodebin ! videoconvert ! comp.sink_0"

 

0 Kudos
Reply