Skip to content

Commit 2402720

Browse files
authored
Initial commit
1 parent 34e705e commit 2402720

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

ffmpeg_7z.bat

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
:: Self-elevation code
5+
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
6+
if '%errorlevel%' NEQ '0' (
7+
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
8+
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
9+
"%temp%\getadmin.vbs"
10+
del "%temp%\getadmin.vbs"
11+
exit /B
12+
)
13+
14+
15+
@echo off
16+
setlocal enabledelayedexpansion
17+
18+
REM Define variables
19+
set "download_url=https://github.com/GyanD/codexffmpeg/releases/download/7.1/ffmpeg-7.1-full_build.7z"
20+
set "temp_file=%TEMP%\ffmpeg.7z"
21+
set "extract_dir=%LOCALAPPDATA%\ffmpeg"
22+
set "full_build_dir=%extract_dir%\ffmpeg-7.1-full_build"
23+
set "bin_dir=%full_build_dir%\bin"
24+
25+
REM Create the directory if it doesn't exist
26+
if not exist "%extract_dir%" (
27+
mkdir "%extract_dir%"
28+
)
29+
30+
REM Download the ffmpeg binary
31+
echo Downloading ffmpeg...
32+
powershell -Command "Invoke-WebRequest -Uri '%download_url%' -OutFile '%temp_file%'"
33+
34+
REM Extract the files using 7z
35+
echo Extracting files...
36+
7z x "%temp_file%" -o"%extract_dir%" -y
37+
38+
REM Add to System Path
39+
set "path=%PATH%;%bin_dir%"
40+
setx PATH "%path%" /M
41+
42+
REM Clean up
43+
del "%temp_file%"
44+
45+
echo ffmpeg has been installed and added to the system path.
46+
pause

ffmpeg_zip.bat

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
4+
:: Self-elevation code
5+
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
6+
if '%errorlevel%' NEQ '0' (
7+
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
8+
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
9+
"%temp%\getadmin.vbs"
10+
del "%temp%\getadmin.vbs"
11+
exit /B
12+
)
13+
14+
15+
REM Define variables
16+
set "download_url=https://github.com/GyanD/codexffmpeg/releases/download/7.1/ffmpeg-7.1-full_build.zip"
17+
set "temp_file=%TEMP%\ffmpeg.zip"
18+
set "extract_dir=%LOCALAPPDATA%\ffmpeg"
19+
set "full_build_dir=%extract_dir%\ffmpeg-7.1-full_build"
20+
set "bin_dir=%full_build_dir%\bin"
21+
22+
REM Create the directory if it doesn't exist
23+
if not exist "%extract_dir%" (
24+
mkdir "%extract_dir%"
25+
)
26+
27+
REM Download the ffmpeg binary
28+
echo Downloading ffmpeg...
29+
powershell -Command "Invoke-WebRequest -Uri '%download_url%' -OutFile '%temp_file%'"
30+
31+
REM Extract the files
32+
echo Extracting files...
33+
powershell -Command "Expand-Archive -Path '%temp_file%' -DestinationPath '%extract_dir%' -Force"
34+
35+
REM Add to System Path
36+
set "path=%PATH%;%bin_dir%"
37+
setx PATH "%path%" /M
38+
39+
REM Clean up
40+
del "%temp_file%"
41+
42+
echo ffmpeg has been installed and added to the system path.
43+
pause

0 commit comments

Comments
 (0)