67
72
self.aencoders = available_audio_encoders()
70
msg = "Export Settings\n"
71
msg += "Video :" + str(self.videowidth) + " " + str(self.videoheight) + " " + str(self.videorate)
75
msg = _("Export Settings\n")
76
msg += _("Video :") + str(self.videowidth) + " " + str(self.videoheight) + " " + str(self.videorate) + " " + str (self.videopar)
72
77
msg += "\n\t" + str(self.vencoder) + " " +str(self.vcodecsettings)
73
msg += "\nAudio :" + str(self.audiochannels) + " " + str(self.audiorate) + " " + str(self.audiodepth)
78
msg += _("\nAudio :") + str(self.audiochannels) + " " + str(self.audiorate) + " " + str(self.audiodepth)
74
79
msg += "\n\t" + str(self.aencoder) + " " + str(self.acodecsettings)
75
msg += "\nMuxer :" + str(self.muxer) + " " + str(self.containersettings)
80
msg += _("\nMuxer :") + str(self.muxer) + " " + str(self.containersettings)
78
def setVideoProperties(self, width=-1, height=-1, framerate=-1):
83
def getVideoCaps(self):
84
""" Returns the GstCaps corresponding to the video settings """
85
astr = "width=%d,height=%d,pixel-aspect-ratio=%d/%d,framerate=%d/%d" % (self.videowidth, self.videoheight,
86
self.videopar.num, self.videopar.denom,
87
self.videorate.num, self.videorate.denom)
88
return gst.caps_from_string("video/x-raw-yuv,%s;video/x-raw-rgb,%s" % (astr, astr))
90
def getVideoDescription(self):
91
""" Returns a human-readable markup-ed string describing the video properties """
92
res = "%d x %d <i>pixels</i> at %.2f <i>fps</i> <i>(%s)</i>"
93
return res % (self.videowidth, self.videoheight,
94
float(self.videorate), self.vencoder)
96
def getAudioDescription(self):
97
""" Returns a human-readable markup-ed string describing the audio properties """
98
res = "%d channels at %d <i>Hz</i> (%d <i>bits</i>) <i>(%s)</i>"
99
return res % (self.audiochannels, self.audiorate, self.audiodepth, self.aencoder)
101
def getAudioCaps(self):
102
""" Returns the GstCaps corresponding to the audio settings """
103
astr = "rate=%d,depth=%d,channels=%d" % (self.audiorate, self.audiodepth, self.audiochannels)
104
return gst.caps_from_string("audio/x-raw-int,%s;audio/x-raw-float,%s" % (astr, astr))
106
def setVideoProperties(self, width=-1, height=-1, framerate=-1, par=-1):
79
107
""" Set the video width, height and framerate """
80
gst.info("set_video_props %d x %d @ %f fps" % (width, height, framerate))
108
gst.info("set_video_props %d x %d @ %r fps" % (width, height, framerate))
82
110
if not width == -1 and not width == self.videowidth:
83
111
self.videowidth = width