From d0f9eec322e2f15a27d586dab2c3ab20d1a25d75 Mon Sep 17 00:00:00 2001 From: LongHairedHacker Date: Fri, 15 May 2015 17:59:34 +0200 Subject: [PATCH] 720p testpiplines --- scripts/test720p.py | 43 +++++++++++++++++++++++++++++++++++++++++++ scripts/test720p.sh | 12 ++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 scripts/test720p.py create mode 100755 scripts/test720p.sh diff --git a/scripts/test720p.py b/scripts/test720p.py new file mode 100644 index 0000000..7e04625 --- /dev/null +++ b/scripts/test720p.py @@ -0,0 +1,43 @@ +#!/bin/env python2 +import pygst +pygst.require('0.10') +import gst + +pipeline = gst.Pipeline('pipeline') + +file_src = gst.element_factory_make('filesrc', 'source'); +file_src.set_property('location', '../videos/tears_of_steel_720p.mkv') + +matroskademux = gst.element_factory_make('matroskademux') +h264parse = gst.element_factory_make('h264parse') +ffdec_h264 = gst.element_factory_make('ffdec_h264') + +colorspace1 = gst.element_factory_make('ffmpegcolorspace') +videoscale = gst.element_factory_make('videoscale') +colorspace2 = gst.element_factory_make('ffmpegcolorspace') + +caps = gst.Caps('video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false') +caps_filter = gst.element_factory_make('capsfilter') +caps_filter.set_property('caps', caps); + +ximagesink = gst.element_factory_make('ximagesink') + +pipeline.add(file_src, matroskademux, h264parse, ffdec_h264, colorspace1, videoscale, colorspace2, caps_filter, ximagesink) +gst.element_link_many(file_src, matroskademux) +gst.element_link_many(h264parse, ffdec_h264, colorspace1, videoscale, colorspace2, caps_filter, ximagesink) + +def on_new_demux_pad(element): + matroskademux.link(h264parse) + pipeline.set_state(gst.STATE_PLAYING) + +matroskademux.connect('no-more-pads', on_new_demux_pad) + +pipeline.set_state(gst.STATE_PAUSED) + + +bus = pipeline.get_bus() +msg = bus.timed_pop_filtered(gst.CLOCK_TIME_NONE, + gst.MESSAGE_ERROR | gst.MESSAGE_EOS) +print msg + +pipeline.set_state(gst.STATE_NULL) diff --git a/scripts/test720p.sh b/scripts/test720p.sh new file mode 100755 index 0000000..5b16ea0 --- /dev/null +++ b/scripts/test720p.sh @@ -0,0 +1,12 @@ +#!/bin/bash + + +MIXERFORMAT='video/x-raw-rgb, bpp=(int)32, endianness=(int)4321, format=(fourcc)BGRA, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false' +SRC="filesrc location=../videos/tears_of_steel_720p.mkv ! matroskademux ! h264parse ! ffdec_h264" +SCALE='ffmpegcolorspace ! videoscale ! ffmpegcolorspace' +gst-launch-0.10 -v \ + $SRC !\ + $SCALE !\ + $MIXERFORMAT !\ + ximagesink +