Beispiel #1
0
 def getAudioCaps(self):
     """ Returns the GstCaps corresponding to the audio settings """
     # TODO: Figure out why including 'depth' causes pipeline failures:
     astr = "rate=%d,channels=%d" % (self.audiorate, self.audiochannels)
     caps_str = "audio/x-raw-int,%s;audio/x-raw-float,%s" % (astr, astr)
     audio_caps = gst.caps_from_string(caps_str)
     if self.aencoder:
         return get_compatible_sink_caps(self.aencoder, audio_caps)
     return audio_caps
Beispiel #2
0
 def getVideoCaps(self, render=False):
     """ Returns the GstCaps corresponding to the video settings """
     videowidth, videoheight = self.getVideoWidthAndHeight(render=render)
     vstr = "width=%d,height=%d,pixel-aspect-ratio=%d/%d,framerate=%d/%d" % (
             videowidth, videoheight,
             self.videopar.num, self.videopar.denom,
             self.videorate.num, self.videorate.denom)
     caps_str = "video/x-raw-yuv,%s;video/x-raw-rgb,%s" % (vstr, vstr)
     video_caps = gst.caps_from_string(caps_str)
     if self.vencoder:
         return get_compatible_sink_caps(self.vencoder, video_caps)
     return video_caps