def setUp(self):
     self.tempdirname1 = Path(tempfile.mkdtemp())
     self.vfs = (bw.testvideosmall().iter_frames(nframes=20).tovideo(
         self.tempdirname1 / 'even1.mp4', framerate=25))
Ejemplo n.º 2
0
 def test_getframe(self):
     vf = bw.testvideosmall()
     frame = vf.get_frame(100)
     self.assertSequenceEqual(frame.shape, (720,1280,3))
Ejemplo n.º 3
0
 def test_extractaudio(self):
     d = Path(tempfile.mkdtemp())
     p = d / 'even.wav'
     bw.testvideosmall().extract_audio(outputpath=p)
     shutil.rmtree(d)
Ejemplo n.º 4
0
 def test_duration(self):
     vf = bw.testvideosmall()
     self.assertEqual(vf.duration, float(19.880000))
Ejemplo n.º 5
0
 def test_nframes(self):
     vf = bw.testvideosmall()
     self.assertEqual(vf.nframes, 497)
Ejemplo n.º 6
0
 def test_countframes(self):
     vf = bw.testvideosmall()
     self.assertEqual(vf.count_frames(), 497)
Ejemplo n.º 7
0
 def test_size(self):
     vf = bw.testvideosmall()
     self.assertEqual(vf.framewidth, 1280)
     self.assertEqual(vf.frameheight, 720)
     self.assertSequenceEqual(vf.framesize, (1280, 720))
Ejemplo n.º 8
0
 def test_videoiterframes(self):
     vf = bw.testvideosmall()
     shape = (vf.frameheight, vf.framewidth, 3)
     for i,frame in enumerate(vf.iter_frames(), 1):
         self.assertEqual(frame.shape, shape)
     self.assertEqual(i, 497)