Ejemplo n.º 1
0
 def _expect(self, iw, ih, ipar, ow, oh, opar, mw, mh, pref, ew, eh, epar):
     rw, rh, rpar = videosize.getVideoSize(iw, ih, ipar,
                                           ow, oh, opar,
                                           mw, mh, pref)
     #print "IN: %s - PREF: %s - OUT: %s" % (self._format(iw, ih, ipar),
     #                                       self._format(ow, oh, opar),
     #                                       self._format(rw, rh, rpar))
     idar = (float(iw) * ipar[0]) / (float(ih) * ipar[1])
     rdar = (float(rw) * rpar[0]) / (float(rh) * rpar[1])
     self.assertTrue(abs(idar - rdar) < 0.03, "Display Aspect Ratio Changed")
     self.assertEquals((rw, rh, rpar), (ew, eh, epar))
Ejemplo n.º 2
0
def _getOutputVideoSize(config, analysis, inputSize):
    """
    Returns the output video (width, height, PAR)
    according to the information from the analysis.
    """
    iw, ih, ipar = inputSize
    ow, oh, opar = videosize.getVideoSize(
        iw,
        ih,
        (ipar.num, ipar.denom),
        config.videoWidth,
        config.videoHeight,
        config.videoPAR,
        config.videoMaxWidth,
        config.videoMaxHeight,
        config.videoScaleMethod,
    )
    return ow, oh, gst.Fraction(*opar)