-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import os | ||
import sys | ||
sys.path.append(os.getcwd()) | ||
|
||
from tools import ffmpegDownloader | ||
|
||
|
||
if os.path.isfile("ffmpeg.exe"): | ||
print("ffmpeg.exe already exists!") | ||
else: | ||
ffmpegDownloader.downloadFFmpeg() | ||
# end if |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import urllib.request | ||
import os | ||
import shutil | ||
import zipfile | ||
|
||
def downloadFFmpeg(): | ||
ffmpegVersion = "6.1.1" | ||
remoteFile = "ffmpeg-%s-full_build" % ffmpegVersion | ||
url = "https://github.com/GyanD/codexffmpeg/releases/download/%s/%s.zip" % (ffmpegVersion, remoteFile) | ||
print("Downloading FFmpeg from %s" % url) | ||
urllib.request.urlretrieve(url, "ffmpeg.zip") | ||
print("Extracting FFmpeg...") | ||
with zipfile.ZipFile("ffmpeg.zip", "r") as zip: | ||
zip.extract("%s/bin/ffmpeg.exe" % remoteFile) | ||
# end with | ||
print("moving ffmpeg.exe to current directory...") | ||
shutil.move(os.path.join(remoteFile, "bin", "ffmpeg.exe"), "ffmpeg.exe") | ||
print("removing temporary files...") | ||
shutil.rmtree(remoteFile) | ||
os.remove("ffmpeg.zip") | ||
print("got ffmpeg!") |