问题
Currently we are using below command to play a video clip:
gst-launch filesrc location=/media/sda1/mpeg4_640x480.mp4 ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! videoscale ! video/x-raw-rgb,width=320, height=240 ! fbdevsink dec. ! queue ! audioconvert ! autoaudiosink
The video frame is reiszed to 320x240 and outputted to the framebuffer. However, we'd like to set the video frame to certain (x, y). Is that possible?
回答1:
Try using the "videobox" element. In the top, left, bottom, and right properties, positive values are used for cropping, so you'll want to use negative values for offsetting.
This pipeline would move a 640x360 video test source to the bottom right corner of a 1280x720 output:
gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=360 ! videoconvert ! videobox left=-640 right=0 top=-360 bottom=0 ! video/x-raw,width=1280,height=720 ! autovideosink
And you can use the "fill" property to control how the space is filled.
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-videobox.html
来源:https://stackoverflow.com/questions/31284897/use-gst-launch-to-output-a-video-frame-to-certain-position-on-framebuffer