[transmageddon] Fix the assumption that a H264 encoder supports multipass encoding
- From: Christian Fredrik Kalager Schaller <uraeus src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [transmageddon] Fix the assumption that a H264 encoder supports multipass encoding
- Date: Thu, 13 Feb 2014 12:47:30 +0000 (UTC)
commit a3cea43aa3c04bff3b52637bf7895899596a07ce
Author: Christian Fredrik Kalager Schaller <uraeus linuxrising org>
Date: Thu Feb 13 13:46:33 2014 +0100
Fix the assumption that a H264 encoder supports multipass encoding
src/transcoder_engine.py | 17 ++++++++++++++---
src/transmageddon.py | 15 +++++++++++++--
2 files changed, 27 insertions(+), 5 deletions(-)
---
diff --git a/src/transcoder_engine.py b/src/transcoder_engine.py
index 4786e82..d9353fa 100644
--- a/src/transcoder_engine.py
+++ b/src/transcoder_engine.py
@@ -73,8 +73,15 @@ class Transcoder(GObject.GObject):
# if needed create a variable to store the filename of the multipass \
# statistics file
if self.multipass != 0:
- self.cachefile = (str (GLib.get_user_cache_dir()) + "/" + \
+ videoencoderplugin = codecfinder.get_video_encoder_element(self.videodata[0]['outputvideocaps'])
+ videoencoder = Gst.ElementFactory.make(videoencoderplugin,"videoencoder")
+ properties=videoencoder.get_property_names()
+ if "multipass-cache-file" in properties:
+ self.cachefile = (str (GLib.get_user_cache_dir()) + "/" + \
"multipass-cache-file" + self.streamdata['timestamp'] + ".log")
+ else:
+ self.multipass=0
+
# gather preset data if relevant
if self.preset != "nopreset":
@@ -153,8 +160,12 @@ class Transcoder(GObject.GObject):
self.pipeline.add(self.videoencoder)
GstPresetType = GObject.type_from_name("GstPreset")
if GstPresetType in GObject.type_interfaces(self.videoencoder):
- bob = self.videoencoder.load_preset(passvalue)
- self.videoencoder.set_property("multipass-cache-file", self.cachefile)
+ self.videoencoder.load_preset(passvalue)
+ properties=self.videoencoder.get_property_names()
+ if "multipass-cache-file" in properties:
+ self.videoencoder.set_property("multipass-cache-file", self.cachefile)
+ else:
+ self.multipass=0
self.multipassfakesink = Gst.ElementFactory.make("fakesink", "multipassfakesink")
self.pipeline.add(self.multipassfakesink)
self.videoencoder.set_state(Gst.State.PAUSED)
diff --git a/src/transmageddon.py b/src/transmageddon.py
index cb43c82..9a3f874 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -59,6 +59,11 @@ dvdfactory=Gst.ElementFactory.find("dvdreadsrc")
if dvdfactory:
dvdfactory.set_rank(300)
+# Enable this to use vaapi hardware decoding. Seems broken atm.
+#vaapifactory=Gst.ElementFactory.find("vaapidecode")
+#if vaapifactory:
+# vaapifactory.set_rank(300)
+
TARGET_TYPE_URI_LIST = 80
dnd_list = [ ( 'text/uri-list', 0, TARGET_TYPE_URI_LIST ) ]
@@ -981,8 +986,14 @@ class TransmageddonUI(Gtk.ApplicationWindow):
context_id = self.StatusBar.get_context_id("EOS")
self.StatusBar.push(context_id, (_("Writing %(filename)s") % {'filename':
self.streamdata['outputfilename']}))
if self.streamdata['multipass'] != 0:
- self.passcounter=int(1)
- self.StatusBar.push(context_id, (_("Pass %(count)d Progress") % {'count': self.passcounter}))
+ videoencoderplugin = codecfinder.get_video_encoder_element(self.videodata[0]['outputvideocaps'])
+ videoencoder = Gst.ElementFactory.make(videoencoderplugin,"videoencoder")
+ properties=videoencoder.get_property_names()
+ if "multipass-cache-file" not in properties:
+ self.multipass=0
+ else:
+ self.passcounter=int(1)
+ self.StatusBar.push(context_id, (_("Pass %(count)d Progress") % {'count': self.passcounter}))
if self.haveaudio:
if "samplerate" in self.audiodata[0]:
# self.check_for_elements()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]