Skip to content

Instantly share code, notes, and snippets.

@nosrednawall
Created January 6, 2021 15:19
Show Gist options
  • Select an option

  • Save nosrednawall/582e4facdbb2b7ee340a46eab8c5a3fc to your computer and use it in GitHub Desktop.

Select an option

Save nosrednawall/582e4facdbb2b7ee340a46eab8c5a3fc to your computer and use it in GitHub Desktop.
convert dav to mp4 python
#!/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)
@nosrednawall
Copy link
Author

Ele irá converter todos os arquivos DAV do diretório em que ele está sendo excutado.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment