X-Git-Url: https://git.ao2.it/experiments/gstreamer.git/blobdiff_plain/0a2c3a7fb0bea571aedb2edab0b9b40d66b9f420..95f8867b3cef764209446c1475b340dc2a3b228b:/gst-custom-player.py?ds=sidebyside diff --git a/gst-custom-player.py b/gst-custom-player.py index 22050ec..cbeace2 100755 --- a/gst-custom-player.py +++ b/gst-custom-player.py @@ -32,7 +32,7 @@ import gst # The player window will have a fixed width and height. # This is just to demonstrate the use of capabilities. WIDTH = 640 -HEIGHT = 480 +HEIGHT = 300 class CustomVideoBin(gst.Bin): @@ -42,21 +42,21 @@ class CustomVideoBin(gst.Bin): queue = gst.element_factory_make('queue', 'vqueue') self.add(queue) - caps = gst.Caps("video/x-raw-yuv,format=(fourcc)AYUV,width=%d,height=%d" % (HEIGHT, WIDTH)) + rescale = gst.element_factory_make("videoscale", "rescale") + self.add(rescale) + + caps = gst.Caps("video/x-raw-yuv,format=(fourcc)AYUV,width=%d,height=%d,pixel-aspect-ratio=1/1" % (WIDTH, HEIGHT)) capsfilter = gst.element_factory_make("capsfilter", "filter") capsfilter.set_property("caps", caps) self.add(capsfilter) - rescale = gst.element_factory_make("videoscale", "rescale") - self.add(rescale) - colorspace = gst.element_factory_make("colorspace", "colorspace") self.add(colorspace) videosink = gst.element_factory_make("autovideosink", "vidoesink") self.add(videosink) - gst.element_link_many(queue, capsfilter, rescale, colorspace, videosink) + gst.element_link_many(queue, rescale, capsfilter, colorspace, videosink) sink = queue.get_pad('sink') self.add_pad(gst.GhostPad('sink', sink))