-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
color management disabled by default a few preset updates
- Loading branch information
Showing
7 changed files
with
233 additions
and
11 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
@ECHO OFF | ||
|
||
TITLE MPV sequence player | ||
|
||
SET "mpv.path=C:\Users\Keerah\AppData\Local\Programs\mpv\" | ||
SET /A mpv.fps=25 | ||
SET /A mpv.sequence.counter=4 | ||
SET /A "mpv.sequence.delim=_" | ||
|
||
SET "mpv.file.name=%~f1" | ||
SET "mpv.file.trname=%~n1" | ||
SET "mpv.file.ext=%~x1" | ||
SET "mpv.file.path=%~dp1" | ||
|
||
SETLOCAL ENABLEDELAYEDEXPANSION | ||
|
||
REM Detecting the counter | ||
|
||
IF DEFINED mpv.file.name ( | ||
IF EXIST "%mpv.file.name%" ( | ||
IF !mpv.sequence.counter! GTR 0 ( | ||
SET "basename=!mpv.file.trname:~0,-%mpv.sequence.counter%!" | ||
SET "countername=!mpv.file.trname:~-%mpv.sequence.counter%!" | ||
|
||
SET "middelim=" | ||
SET /A frnumber=-1 | ||
|
||
REM Constructing zero pattern | ||
SET "zer=" | ||
FOR /L %%I IN (1,1,!mpv.sequence.counter!) DO SET "zer=!zer!0" | ||
|
||
IF !countername!==!zer! ( | ||
REM Zero frame | ||
SET /A frnumber=0 | ||
ECHO Frame counter detected at the end of the filename, digits: [01m!mpv.sequence.counter![0m. | ||
) ELSE ( | ||
REM Validating frame number at the end | ||
SET "ddet=" | ||
FOR /F "delims=0123456789" %%I IN ("!countername!") DO SET ddet=%%i | ||
IF DEFINED ddet ( | ||
REM Not a number | ||
ECHO The last [01m!mpv.sequence.counter![0m symbols of the filename is not a number. | ||
IF DEFINED mpv.sequence.delim ( | ||
REM Try to use delimiter | ||
FOR /f "tokens=1-3 delims=%mpv.sequence.delim%" %%A in ("!mpv.file.trname!") do ( | ||
SET "beforedelim=%%A" | ||
SET "middelim=%%B" | ||
SET "afterdelim=%%C" | ||
) | ||
REM Limiting the counter. Lazy way, will consider string length calculation in future to get all digits | ||
SET "middelimtr=!middelim:~0,%mpv.sequence.counter%!" | ||
|
||
REM Validating frame number after delimiter | ||
SET "ddet=" | ||
FOR /F "delims=0123456789" %%I IN ("!middelimtr!") DO SET ddet=%%i | ||
IF DEFINED ddet ( | ||
ECHO No frame counter found after delimiter "[01m!mpv.sequence.delim![0m". No image sequence assumed. | ||
) ELSE ( | ||
ECHO Frame counter detected after delimiter "[01m!mpv.sequence.delim![0m", digits: [01m!mpv.sequence.counter![0m. | ||
REM Removing leading zeroes (if any) | ||
FOR /F "tokens=* delims=0" %%N IN ("!middelimtr!") DO SET "frnumbername=%%N" | ||
SET /A "frnumber=!frnumbername!" | ||
) | ||
) ELSE ( | ||
ECHO Delimiter symbol is set to empty, no sequence detection. | ||
SET /A frnumber=-1 | ||
SET "wset.in.sequence.range=" | ||
SET "wset.out.sequence.range=-update 1 -frames:v 1" | ||
) | ||
) ELSE ( | ||
ECHO Frame counter detected at the end of the filename, digits: [01m!mpv.sequence.counter![0m. | ||
REM Removing leading zeroes (if any) | ||
FOR /F "tokens=* delims=0" %%N IN ("!countername!") DO SET "frnumbername=%%N" | ||
SET /A "frnumber=!frnumbername!" | ||
) | ||
) | ||
|
||
IF !frnumber! GTR -1 ( | ||
IF NOT DEFINED middelim ( | ||
REM Constructing the pattern in the end of the name | ||
SET "mpv.file.pat=!basename!*" | ||
) ELSE ( | ||
REM Constructing the pattern after the delimiter | ||
REM If middelim was trimmed to mpv.sequence.counter = add the trimmed part to filename | ||
IF !middelim! == !middelimtr! (SET "midsfx=") ELSE (SET midsfx=!middelim:~%mpv.sequence.counter%!) | ||
SET "mpv.file.pat=!beforedelim!!mpv.sequence.delim!*!mpv.sequence.delim!!afterdelim!" | ||
SET "basename=!beforedelim!" | ||
) | ||
ECHO Basename: [03m"!basename!"[0m, start frame: [01m!frnumber![0m, pattern: [03m"!mpv.file.pat!!mpv.file.ext!"[0m | ||
REM Replace counter with the pattern | ||
SET "mpv.file.name=!mpv.file.path!!mpv.file.pat!!mpv.file.ext!" | ||
|
||
) | ||
|
||
REM Playing | ||
ECHO Let's play at !mpv.fps! fps... | ||
"!mpv.path!mpv.exe" "!mpv.file.name!" "--merge-files=yes" "--no-correct-pts" "--fps=!mpv.fps!" "--idle=yes" "--loop=inf" "--title=Playing !mpv.file.name!" | ||
|
||
) ELSE ( | ||
ECHO The counter length is not set or zero | ||
) | ||
) ELSE ( | ||
ECHO The file was not found | ||
) | ||
) ELSE ( | ||
ECHO No file specified | ||
) |
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
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,51 @@ | ||
@ECHO OFF | ||
REM SendTo_FFmpeg is an FFmpeg based set of batch scripts for transcoding | ||
REM Download from https://github.com/keerah/SendTo_FFmpeg | ||
REM jpeg compatible preset | ||
|
||
REM === compression settings ======================================================================= | ||
SET "wset.out.video.rate=10" | ||
REM mjpeg codec supports: 2 - 32 (high to low quality) | ||
SET "wset.out.video.fps=1" | ||
REM Output framerate in Hz. 1 is to output 1 frame per second. Leave empty for no change. Set to negative value to override input framerate to the Abs(fps), this is useful for Gifs to presere all frames but change speed | ||
SET "wset.out.video.scale.x=-1" | ||
REM Leave empty to disable scaling. -1 is to scale proportionally, -2 to also keep it to multiple of 2 | ||
SET "wset.out.video.scale.y=512" | ||
REM Leave empty to disable scaling. -1 is to scale proportionally, -2 to also keep it to multiple of 2 | ||
SET "wset.out.video.scale.algo=lanczos" | ||
REM bilinear, bicubic, bicublin, gauss, sinc, lanczos, spline and more https://ffmpeg.org/ffmpeg-scaler.html | ||
SET "wset.out.format=.jpg" | ||
SET "wset.out.video.codec=mjpeg" | ||
SET "wset.out.video.sampling=yuvj422p" | ||
REM mjpeg supports: yuvj444p, yuvj420p, yuvj422p, yuv420p, yuv422p, yuv444p | ||
SET "wset.out.params=-hide_banner -stats" | ||
SET "wset.out.sequence=1" | ||
|
||
REM === color management settings ================================================================== | ||
SET "wset.in.cm.space=bt709" | ||
SET "wset.in.cm.primaries=bt709" | ||
SET "wset.in.cm.transfer=bt709" | ||
SET "wset.in.cm.range=tv" | ||
SET "wset.out.cm.space=bt709" | ||
SET "wset.out.cm.primaries=bt709" | ||
SET "wset.out.cm.transfer=bt709" | ||
SET "wset.out.cm.range=tv" | ||
REM Leave the cm.space empty to disable management for input/output. Color spaces: rgb, bt709, fcc, bt470bg, bt2020nc, bt2020c, smpte170m, smpte240m. Ranges: pc, tv, mpeg, jpeg. Primaries: bt709, bt470m, bt470bg, bt2020, film, smpte170m, smpte240m. Transforms: bt709, gamma22, gamma28, linear, log, log_sqrt, bt2020_10, bt2020_12, smpte170m, smpte240m. For full list refer to https://ffmpeg.org/ffmpeg-codecs.html | ||
REM ================================================================================================ | ||
|
||
COLOR 0F | ||
SETLOCAL ENABLEDELAYEDEXPANSION | ||
SET /A stf.result=0 | ||
SET /A stf.pause=1 | ||
|
||
IF EXIST "%~dp0sendtoffmpeg_run.cmd" ( | ||
SET "wset.out.type=03" | ||
CALL "%~dp0sendtoffmpeg_run.cmd" %* | ||
) ELSE ( | ||
SET /A stf.result=5 | ||
ECHO [31mSorry, the [01m[30m[41msendtoffmpeg_run.cmd[0m[31m module is unreacheable. Unable to continue^^![0m | ||
) | ||
|
||
IF %stf.result% GTR 0 ECHO [31mResult code is %stf.result%[0m | ||
ECHO. | ||
if NOT %stf.pause% == 0 PAUSE |
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,64 @@ | ||
@ECHO OFF | ||
REM SendTo_FFmpeg is an FFmpeg based set of batch scripts for transcoding | ||
REM Download from https://github.com/keerah/SendTo_FFmpeg | ||
REM vp compatible preset | ||
|
||
REM === compression settings ======================================================================= | ||
SET "wset.out.video.rate=20" | ||
REM copy to copy the stream, libvpx-vp9 crf supports: -1 to 63 | ||
SET "wset.out.audio.rate=128k" | ||
REM 64k, 96k, 128k, 256k, 320k, copy to copy the stream, leave empty to disable audio | ||
SET "wset.out.video.scale.x=" | ||
REM Leave empty to disable scaling. -1 is to scale proportionally, -2 to also keep it to multiple of 2 | ||
SET "wset.out.video.scale.y=" | ||
REM Leave empty to disable scaling. -1 is to scale proportionally, -2 to also keep it to multiple of 2 | ||
SET "wset.out.video.scale.algo=lanczos" | ||
REM bilinear, bicubic, bicublin, gauss, sinc, lanczos, spline and more https://ffmpeg.org/ffmpeg-scaler.html. Can be combined using + | ||
SET "wset.out.video.fps=" | ||
REM Output framerate in Hz. 1 is to output 1 frame per second. Leave empty for no change. Set to negative value to override input framerate to the Abs(fps), this is useful for Gifs to presere all frames but change playback speed | ||
SET "wset.out.format=.webm" | ||
SET "wset.out.video.codec=libvpx-vp9" | ||
REM h264_nvenc, hevc_nvenc - CUDA h264, h265 encoders. h264_qsv, hevc_qsv - Intel Quick Sync h264, h265 encoders. libvpx, libvpx-vp9, vp9_qsv - vp8, vp9 codecs. libx264, libx265dnxhd, prores, prores_aw, prores_ks, rawvideo. Use "ffmpeg -ecncoders" command to list. Other codecs may have requirements not compatible with this preset | ||
SET "wset.out.video.sampling=yuv420p" | ||
REM libvpx-vp9 supports: yuv420p yuva420p yuv422p yuv440p yuv444p yuv420p10le yuv422p10le yuv440p10le yuv444p10le yuv420p12le yuv422p12le yuv440p12le yuv444p12le gbrp gbrp10le gbrp12le | ||
SET "wset.out.video.preset=best" | ||
REM libvpx-vp9 supports: good, best, realtime | ||
SET "wset.out.video.tune=film" | ||
REM libvpx-vp9 supports: default, screen, film | ||
SET "wset.out.audio.codec=libvorbis" | ||
REM aac, aac_mf, alac, flac, mp3_mf, opus, pcm_s16le, pcm_s24le, vorbis. Use "ffmpeg -ecncoders" command to list. Other codecs may have requirements not compatible with this preset | ||
SET "wset.out.audio.sampling=" | ||
REM Not used yet. aac supports: 96000 88200 64000 48000 44100 32000 24000 22050 16000 12000 11025 8000 7350 | ||
SET "wset.in.audio.file.extension=.wav" | ||
REM If the file extension is defined here (eg .wav), the audio file with the same name as the source's but with this extension will be added as audio to the output. Use uncompressed audio like wav for faster and more precise muxing | ||
SET "wset.out.params=-hide_banner -stats" | ||
SET "wset.out.sequence=0" | ||
|
||
REM === color management settings ================================================================== | ||
SET "wset.in.cm.space=bt709" | ||
SET "wset.in.cm.primaries=bt709" | ||
SET "wset.in.cm.transfer=bt709" | ||
SET "wset.in.cm.range=pc" | ||
SET "wset.out.cm.space=bt709" | ||
SET "wset.out.cm.primaries=bt709" | ||
SET "wset.out.cm.transfer=bt709" | ||
SET "wset.out.cm.range=pc" | ||
REM Leave the cm.space empty to disable management for input/output. Color spaces: rgb, bt709, fcc, bt470bg, bt2020nc, bt2020c, smpte170m, smpte240m. Ranges: pc, tv, mpeg, jpeg. Primaries: bt709, bt470m, bt470bg, bt2020, film, smpte170m, smpte240m. Transforms: bt709, gamma22, gamma28, linear, log, log_sqrt, bt2020_10, bt2020_12, smpte170m, smpte240m. For full list refer to https://ffmpeg.org/ffmpeg-codecs.html | ||
REM ================================================================================================ | ||
|
||
COLOR 0F | ||
SETLOCAL ENABLEDELAYEDEXPANSION | ||
SET /A stf.result=0 | ||
SET /A stf.con.pause=1 | ||
|
||
IF EXIST "%~dp0sendtoffmpeg_run.cmd" ( | ||
SET "wset.out.type=07" | ||
CALL "%~dp0sendtoffmpeg_run.cmd" %* | ||
) ELSE ( | ||
SET /A stf.result=5 | ||
ECHO [31mSorry, the [01m[30m[41msendtoffmpeg_run.cmd[0m[31m module is unreacheable. Unable to continue^^![0m | ||
) | ||
|
||
IF %stf.result% GTR 0 ECHO [31mResult code is %stf.result%[0m | ||
ECHO. | ||
if NOT %stf.con.pause% == 0 PAUSE |
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