1
0
Fork 0
mirror of synced 2025-07-03 11:57:26 +02:00

Add mp4 support

This commit is contained in:
jvoisin 2018-10-28 07:41:04 -07:00
parent 3a070b0ab7
commit 04bb8c8ccf
4 changed files with 101 additions and 19 deletions

BIN
tests/data/dirty.mp4 Normal file

Binary file not shown.

View file

@ -521,3 +521,26 @@ class TestCleaning(unittest.TestCase):
os.remove('./tests/data/dirty.cleaned.zip')
os.remove('./tests/data/dirty.cleaned.cleaned.zip')
def test_mp4(self):
try:
video._get_ffmpeg_path()
except RuntimeError:
raise unittest.SkipTest
shutil.copy('./tests/data/dirty.mp4', './tests/data/clean.mp4')
p = video.MP4Parser('./tests/data/clean.mp4')
meta = p.get_meta()
self.assertEqual(meta['Encoder'], 'HandBrake 0.9.4 2009112300')
ret = p.remove_all()
self.assertTrue(ret)
p = video.MP4Parser('./tests/data/clean.cleaned.mp4')
self.assertNotIn('Encoder', p.get_meta())
self.assertTrue(p.remove_all())
os.remove('./tests/data/clean.mp4')
os.remove('./tests/data/clean.cleaned.mp4')
os.remove('./tests/data/clean.cleaned.cleaned.mp4')