-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAddVi.bat
More file actions
31 lines (24 loc) · 996 Bytes
/
Copy pathAddVi.bat
File metadata and controls
31 lines (24 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
:: Version 20231028
@echo off
chcp 65001 > nul
setlocal enabledelayedexpansion
REM Prompt the user to input text
set /p "sometext=Enter citation text: "
REM Escape delimiters and quotes in the input text
set "citationtext=!sometext:\=\\!"
set "citationtext=!citationtext::=\\\:!"
REM Extract the directory path from the input video file
for %%I in ("%~1") do (
set "output_dir=%%~dpI"
set "output_filename=%%~nI_Vi.mp4"
)
REM Run FFmpeg with the specified filter and font, saving the output in the same directory
cd %~dp0
ffmpeg -i "%~1" -vf "delogo=x=85:y=47:w=300:h=40:show=0,drawtext=text='!citationtext!':font=Noto Sans Bold:fontcolor=white:fontsize=30:x=93:y=53:alpha=0.9" "!output_dir!!output_filename!"
REM Check if FFmpeg command was successful
if %errorlevel% eq 0 (
echo Video processing complete. Output saved as !output_dir!!output_filename!
) else (
echo Video processing failed. Check the input file and FFmpeg command.
)
pause