-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathvideoInvert.cmd
More file actions
33 lines (27 loc) · 874 Bytes
/
videoInvert.cmd
File metadata and controls
33 lines (27 loc) · 874 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
32
33
@echo off
echo ###################################################
echo # Description: Invert colors in a video
echo # Usage: videoInvert.cmd /path/to/video.mp4 ["-crf 20"]
echo # Param 1: Video file
echo # Param 2 [Optional]: Custom ffmpeg args (default: "-crf 23")
echo # Requires: ffmpeg
echo ###################################################
echo.
REM Check parameters
IF "%~1"=="" (
echo Error: 1st arg must be a video file
exit /b 1
)
REM Set defaults
set "customArgs=-crf 23"
IF NOT "%~2"=="" set "customArgs=%~2"
REM Get filename
set "filename=%~1"
set "outputFile=%~n1.inverted%~x1"
echo Inverting video colors: %filename%
echo Using custom args: %customArgs%
REM Do conversion
ffmpeg -i "%filename%" -vf negate -c:v libx264 -pix_fmt yuv420p %customArgs% -c:a copy "%outputFile%"
REM Complete
echo Success: Video colors inverted:
echo # %outputFile%