[transmageddon] fix normal transcoding, with both deinterlace and videoflip active
- From: Christian Fredrik Kalager Schaller <uraeus src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [transmageddon] fix normal transcoding, with both deinterlace and videoflip active
- Date: Sat, 28 May 2011 10:25:59 +0000 (UTC)
commit 77fefc4baa725131558517c551fd3348482311ad
Author: Christian Fredrik Kalager Schaller <christian schaller collabora co uk>
Date: Sat May 28 11:23:56 2011 +0100
fix normal transcoding, with both deinterlace and videoflip active
src/transcoder_engine.py | 36 +++++++++++++++++++-----------------
1 files changed, 19 insertions(+), 17 deletions(-)
---
diff --git a/src/transcoder_engine.py b/src/transcoder_engine.py
index 596e6c4..6782677 100644
--- a/src/transcoder_engine.py
+++ b/src/transcoder_engine.py
@@ -99,7 +99,6 @@ class Transcoder(gobject.GObject):
if self.preset != "nopreset":
height, width, num, denom, pixelaspectratio = self.provide_presets()
for acap in self.audiocaps:
- acap["rate"] = self.samplerate
acap["channels"] = self.channels
for vcap in self.videocaps:
vcap["height"] = height
@@ -139,6 +138,23 @@ class Transcoder(gobject.GObject):
self.encodebin.set_property("avoid-reencoding", True)
self.pipeline.add(self.encodebin)
+ if self.videopasstoggle==False:
+ self.videoflipper = gst.element_factory_make("videoflip")
+ self.videoflipper.set_property("method", self.rotationvalue)
+ self.pipeline.add(self.videoflipper)
+
+ self.deinterlacer = gst.element_factory_make("deinterlace")
+ self.pipeline.add(self.deinterlacer)
+
+ self.colorspaceconversion = gst.element_factory_make("ffmpegcolorspace")
+ self.pipeline.add(self.colorspaceconversion)
+
+ self.deinterlacer.link(self.colorspaceconversion)
+ self.colorspaceconversion.link(self.videoflipper)
+ self.deinterlacer.set_state(gst.STATE_PAUSED)
+ self.colorspaceconversion.set_state(gst.STATE_PAUSED)
+ self.videoflipper.set_state(gst.STATE_PAUSED)
+
self.remuxcaps = gst.Caps()
if self.audiopasstoggle:
self.remuxcaps.append(self.audiocaps)
@@ -198,8 +214,6 @@ class Transcoder(gobject.GObject):
self.blackborderflag = True
else:
self.blackborderflag = False
- # Check for audio samplerate
- self.samplerate = int(preset.acodec.samplerate)
# calculate number of channels
chanmin, chanmax = preset.acodec.channels
if int(self.achannels) < int(chanmax):
@@ -215,14 +229,6 @@ class Transcoder(gobject.GObject):
hmin, hmax = preset.vcodec.height
width, height = self.owidth, self.oheight
- self.vpreset = []
- voutput = preset.vcodec.presets[0].split(", ")
- for x in voutput:
- self.vpreset.append(x)
- self.apreset = []
- aoutput = preset.acodec.presets[0].split(", ")
- for x in aoutput:
- self.apreset.append(x)
# Get Display aspect ratio
pixelaspectratio = preset.vcodec.aspectratio[0]
@@ -356,13 +362,9 @@ class Transcoder(gobject.GObject):
src_pad.link(sinkpad)
elif c.startswith("video/"):
if self.videopasstoggle==False:
- print "self.rotationvalue is " + str(self.rotationvalue)
- self.videoflipper = gst.element_factory_make("videoflip")
- self.videoflipper.set_property("method", self.rotationvalue)
- self.pipeline.add(self.videoflipper)
- src_pad.link(self.videoflipper.get_static_pad("sink"))
+ src_pad.link(self.deinterlacer.get_static_pad("sink"))
self.videoflipper.get_static_pad("src").link(sinkpad)
- self.videoflipper.set_state(gst.STATE_PAUSED)
+
else:
src_pad.link(sinkpad)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]