Skip to content

Instantly share code, notes, and snippets.

@lextra2
lextra2 / drag.and.drop.encode.flac.bat
Last active May 16, 2019 02:09
FFMPEG.BAT - Encodes the first audio stream of all files that are dropped onto this .bat as .flac and outputs them in the same folder. Requires all files to be in the same location.
@echo off
:next
if "%~1" == "" goto done
ffmpeg -i "%~1" -map_metadata -1 -vn -c:a flac "%~1.flac"
shift
goto next
:done
exit
@lextra2
lextra2 / encode.all.flac.bat
Last active May 16, 2019 00:36
FFMPEG.BAT - Creates a new FLAC folder and encodes the first audio stream from all files in this .bat location as .flac, than moves them to the new FLAC folder. Requires all files to be in the same location.
mkdir FLAC
for %%a in (*) do (
ffmpeg -i "%%a" -map_metadata -1 -vn -c:a flac "FLAC\%%~na.flac"
)
@lextra2
lextra2 / h264.two.pass.flac.bat
Last active May 16, 2019 00:36
FFMPEG.BAT - Encodes the first video/audio stream of all mkv files in this .bat location into h264 two-pass/flac, than moves them to the ENCODED folder. Requires all files to be in the same location.
mkdir ENCODED
for %%a in (*.mkv) do (
ffmpeg -i "%%a" -map_metadata -1 -map_chapters -1 -c:v libx264 -b:v 5M -preset medium -tune animation -pass 1 -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -an "ENCODED\%%~na.mkv"
ffmpeg -y -i "%%a" -c:v libx264 -b:v 5M -preset medium -tune animation -pass 2 -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -c:a flac "ENCODED\%%~na.mkv"
)
@lextra2
lextra2 / pipe-AVS-to-FFMPEG-X264-2-Pass.bat
Last active May 28, 2019 13:06
FFMPEG.BAT - Same as https://gist.github.com/lextra2/4722bde44949990ae98af192ccd7799d but for .avs and no audio. Writes SSIM+PSNR to .log file. Requires all files to be in the same location.
mkdir ENCODED
for %%a in (*.avs) do (
ffmpeg -y -i "%%a" -c:v libx264 -x264-params "ssim=1:psnr=1:pass=1" -preset medium -tune animation -b:v 3500K -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 "ENCODED\%%~na.mkv"
ffmpeg -report -benchmark -y -i "%%a" -c:v libx264 -x264-params "ssim=1:psnr=1:pass=2" -preset medium -tune animation -b:v 3500K -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 "ENCODED\%%~na.mkv"
)
@lextra2
lextra2 / mpv.conf
Last active May 4, 2020 05:48
My mpv.conf - constantly changing
[default]
# general
#glsl-shader="~~/FSRCNNX_x2_8-0-4-1.glsl"
#glsl-shader="~~/SSimDownscaler.glsl"
#glsl-shader="~~/SSimSuperRes.glsl"
#glsl-shader="~~/KrigBilateral.glsl"
#glsl-shader="~~/adaptive-sharpen.glsl"
#profile=gpu-hq
@lextra2
lextra2 / input.conf
Last active April 25, 2020 10:24
My mpv input.conf
WHEEL_UP add volume 5
WHEEL_DOWN add volume -5
LEFT seek -5 exact
RIGHT seek 5 exact
CTRL+LEFT frame-back-step ; show-text "${estimated-frame-number}/${estimated-frame-count}"
CTRL+RIGHT frame-step ; show-text "${estimated-frame-number}/${estimated-frame-count}"
SHIFT+LEFT playlist-prev ; show-text "${playlist-pos-1}/${playlist-count}"
@lextra2
lextra2 / waifu2x.bat
Last active May 26, 2019 05:37
WAIFU2X.BAT - For https://github.com/nihui/waifu2x-ncnn-vulkan - Makes waifu2x process all .png in this .bat location, and moves them to the newely created UPSCALED folder. Requires all files to be in the same location.
mkdir UPSCALED
for %%a in (*.png) do (
waifu2x "%%a" "UPSCALED\%%~na.png" 1 2 400
)
@lextra2
lextra2 / copy+paste this into powershell
Last active May 28, 2019 13:04
POWERSHELL - WAIFU2X - Prints out the total duration inside the shell window - the second command is only used for manual execution (without .bat)
Measure-Command {.\waifu2x.bat}
or this for manual execution
Measure-Command {.\waifu2x.exe input.png output.png 2 2 400}
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e