[transmageddon] Another small fix, this time fixing encoding an mp3 file. Multifile handling still broken for this u



commit 8cc9782444711f4ad876c29e7eed04f6aeafb258
Author: Christian Fredrik Kalager Schaller <uraeus linuxrising org>
Date:   Tue Sep 3 16:45:33 2013 +0200

    Another small fix, this time fixing encoding an mp3 file. Multifile handling
    still broken for this usecase though

 src/transcoder_engine.py |   21 ++++++++-------------
 src/transmageddon.py     |    1 -
 2 files changed, 8 insertions(+), 14 deletions(-)
---
diff --git a/src/transcoder_engine.py b/src/transcoder_engine.py
index c790a6d..ca76d05 100644
--- a/src/transcoder_engine.py
+++ b/src/transcoder_engine.py
@@ -43,14 +43,10 @@ class Transcoder(GObject.GObject):
        self.audiodata = AUDIODATA
        self.videodata = VIDEODATA
        self.streamdata = STREAMDATA
-       self.container = self.streamdata['container']
-       if self.container != False: 
-           self.containercaps = self.container #FIXME This double variable is a leftover from old code
-       # special case mp3 which is a no-container format with a container (id3mux)
-       else:
-           if self.audiocaps.intersect(Gst.caps_from_string("audio/mpeg, mpegversion=1, layer=3")):
-               self.containercaps=Gst.caps_from_string("application/x-id3")
-               self.container=Gst.caps_from_string("application/x-id3")
+       if self.streamdata['container'] == False:
+          # FIXME - needs to be multistream enabled
+          if self.audiodata[0]['outputaudiocaps'].intersect(Gst.caps_from_string("audio/mpeg, mpegversion=1, 
layer=3")):
+               self.streamdata['container']=Gst.caps_from_string("application/x-id3")
 
        # set preset directory
        Gst.preset_set_app_dir("/usr/share/transmageddon/presets/")
@@ -105,13 +101,13 @@ class Transcoder(GObject.GObject):
            videopreset=None
 
        # first check if we are using a container format
-       if self.container==False:
+       if self.streamdata['container']==False:
            if self.audiocaps.intersect(Gst.caps_from_string("audio/mpeg, mpegversion=4")):
                self.audiocaps=Gst.caps_from_string("audio/mpeg, mpegversion=4, stream-format=adts")
            elif self.audiocaps.intersect(Gst.caps_from_string("audio/x-flac")):
                self.audiocaps=Gst.caps_from_string("audio/x-flac")
        else:
-           self.encodebinprofile = GstPbutils.EncodingContainerProfile.new("containerformat", None , 
self.containercaps, None)
+           self.encodebinprofile = GstPbutils.EncodingContainerProfile.new("containerformat", None , 
self.streamdata['container'], None)
  
            # What to do if we are not doing video passthrough (we only support video inside a 
            # container format
@@ -143,10 +139,9 @@ class Transcoder(GObject.GObject):
        # including any extra elements between uridecodebin and encodebin
        x=0
        self.audioprofilenames=[]
-       # print(self.audiodata)
        while x < len(self.audiodata): 
            if self.audiodata[x]['outputaudiocaps'] != (False or "noaud"):
-               if self.container==False:
+               if self.streamdata['container']==False:
                    self.encodebinprofile = GstPbutils.EncodingAudioProfile.new 
(self.audiodata[x]['outputaudiocaps'], audiopreset, Gst.Caps.new_any(), 0)
                else:
                    audiopreset=None
@@ -381,7 +376,7 @@ class Transcoder(GObject.GObject):
 
    def OnDynamicPad(self, uridecodebin, src_pad):
        origin = src_pad.query_caps(None)
-       if (self.container==False):
+       if (self.streamdata['container']==False):
            a =  origin.to_string()
            if a.startswith("audio/"):
                sinkpad = self.encodebin.get_static_pad("audio_0")
diff --git a/src/transmageddon.py b/src/transmageddon.py
index 855ec56..cc87ef7 100644
--- a/src/transmageddon.py
+++ b/src/transmageddon.py
@@ -951,7 +951,6 @@ class TransmageddonUI(Gtk.ApplicationWindow):
        # pick output suffix
        container = self.builder.get_object("containerchoice").get_active_text()
        if self.streamdata['container']==False: # deal with container less formats
-           print(self.audiodata)
            #FIXME - need to find stream that is being transcoded and choose suffix based on the outputcaps 
of that
            self.ContainerFormatSuffix = 
codecfinder.nocontainersuffixmap[Gst.Caps.to_string(self.audiodata[0]['outputaudiocaps'])]
        else:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]