1

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?

wthung
  • 167
  • 2
  • 12

1 Answers1

3

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

mpr
  • 3,250
  • 26
  • 44
  • videobox element can meet our requirement. However, setting border-alpha=0 still get black border in our device because of our framebuffer is only 16 bits (I guess). The "fill" property looks like it is unable to fill a transparent color. Still looking for a solution. – wthung Jul 09 '15 at 02:46
  • If you have other processes drawing into the buffer, or no alpha layer, you may have to write a custom appsink. You may also want to look into using mplayer and it's "geometry" parameter if all you're doing is playing a video. – mpr Jul 09 '15 at 13:29