Created
January 6, 2021 15:19
-
-
Save nosrednawall/582e4facdbb2b7ee340a46eab8c5a3fc to your computer and use it in GitHub Desktop.
convert dav to mp4 python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| from os import system | |
| from os import walk | |
| import ffmpeg # pip isntall ffmpeg ffmpeg-python | |
| import os | |
| def convertVideo(filenameVideo): | |
| name, ext = os.path.splitext(filenameVideo) | |
| out_name = name + ".mp4" | |
| stream = ffmpeg.input(filenameVideo) | |
| stream = ffmpeg.output(stream, out_name) | |
| ffmpeg.run(stream) | |
| print("Finished converting {}".format(out_name)) | |
| for root, dirs, files in os.walk("."): | |
| for filename in files: | |
| if(filename.endswith('.dav')): | |
| print(filename) | |
| convertVideo(filename) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ele irá converter todos os arquivos DAV do diretório em que ele está sendo excutado.