[transmageddon] more fixes for dealing with audio extraction
- From: Christian Fredrik Kalager Schaller <uraeus src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [transmageddon] more fixes for dealing with audio extraction
- Date: Sat, 15 Mar 2014 17:19:05 +0000 (UTC)
commit f8475b09b36d88328ab6692b10d6bf5751c819ce
Author: Christian Fredrik Kalager Schaller <uraeus linuxrising org>
Date: Sat Mar 15 18:18:43 2014 +0100
more fixes for dealing with audio extraction
src/transcoder_engine.py | 17 ++++++++++++-----
1 files changed, 12 insertions(+), 5 deletions(-)
---
diff --git a/src/transcoder_engine.py b/src/transcoder_engine.py
index 221e719..cabcfdb 100644
--- a/src/transcoder_engine.py
+++ b/src/transcoder_engine.py
@@ -97,7 +97,14 @@ class Transcoder(GObject.GObject):
# these values should not be hardcoded, but gotten from profile XML file
# audiopreset=None
# videopreset=None
-
+
+ if self.streamdata['container'] == False:
+ x=0
+ while x < len(self.audiodata):
+ if self.audiodata[x]['outputaudiocaps'] != 'noaud':
+ if not (self.audiodata[x]['outputaudiocaps'].intersect(Gst.caps_from_string("audio/mpeg,
mpegversion=1, layer=3"))).is_empty():
+ self.streamdata['container']=Gst.caps_from_string("application/x-id3")
+ x=x+1
if not self.streamdata['container']==False:
self.encodebinprofile = GstPbutils.EncodingContainerProfile.new("containerformat", None ,
self.streamdata['container'], None)
@@ -344,6 +351,7 @@ class Transcoder(GObject.GObject):
def OnDynamicPad(self, uridecodebin, src_pad):
origin = src_pad.query_caps(None)
+ print(self.streamdata['container'].to_string())
if (self.streamdata['container']==False):
a = origin.to_string()
if a.startswith("audio/"): # this is for audio only files
@@ -353,10 +361,9 @@ class Transcoder(GObject.GObject):
if self.videodata[0]['outputvideocaps'] == False:
c = origin.to_string()
if c.startswith("audio/"):
- sinkpad = self.encodebin.emit("request-pad", origin)
- d = sinkpad.query_caps().to_string()
- if d.startswith("audio/"):
- src_pad.link(sinkpad)
+ sinkpad = self.encodebin.get_static_pad("audio_0")
+ print("sinkpad is " + str(sinkpad))
+ src_pad.link(sinkpad)
else:
# Checking if its a subtitle pad which we can't deal with
# currently.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]