Exemplo n.º 1
0
    def test_get_duration(self):
        screen = path.join(self.base_dir, 'SCREEN.mp4')
        camera = path.join(self.base_dir, 'CAMERA.mp4')
        audio = path.join(self.base_dir, 'AUDIO.mp3')

        self.assertEqual(mediainfo.get_duration(screen), 1)
        self.assertEqual(mediainfo.get_duration(camera), 1)
        self.assertEqual(mediainfo.get_duration(audio), 1)
Exemplo n.º 2
0
    def test_get_duration(self):   
        screen = path.join(self.base_dir, 'SCREEN.mp4')
        camera = path.join(self.base_dir, 'CAMERA.mp4')
        audio = path.join(self.base_dir, 'AUDIO.mp3')

        self.assertEqual(mediainfo.get_duration(screen), 1)
        self.assertEqual(mediainfo.get_duration(camera), 1)
        self.assertEqual(mediainfo.get_duration(audio) , 1)
Exemplo n.º 3
0
 def assertCorrectRecording(self, bins, duration=0):
     for bin in bins:
         self.assertTrue(path.exists(path.join(self.tmppath, bin['file'])))
         if duration:
             self.assertTrue(path.getsize(path.join(self.tmppath, bin['file'])) > 0)
             self.assertEqual(get_duration(path.join(self.tmppath, bin['file'])), duration)
         else:
             self.assertTrue(path.getsize(path.join(self.tmppath, bin['file'])) == 0)
Exemplo n.º 4
0
    def __discover(self, filepath):
        self.duration = 0
        try:
            self.duration = get_duration(filepath)
            logger.info("Duration ON_DISCOVERED: " + str(self.duration))
        except Exception as exc:
            logger.warning("Error trying to get duration of {}: {}".format(filepath, exc))

        self.create_pipeline()
        return True
Exemplo n.º 5
0
 def __discover(self, filepath):
     self.duration = get_duration(filepath)
     logger.info("Duration ON_DISCOVERED: " + str(self.duration))
     self.create_pipeline()
     return True