Skip to content

Instantly share code, notes, and snippets.

View ScribbleGhost's full-sized avatar

ScribbleGhost ScribbleGhost

View GitHub Profile
@ScribbleGhost
ScribbleGhost / EAC log with or without gap detection.log
Last active July 7, 2022 07:20
EAC log with or without gap detection
Exact Audio Copy V1.6 from 23. October 2020
EAC extraction logfile from 4. July 2022, 15:56
Unknown Artist / Unknown Title
Used drive : ASUS BW-XXXX-X Adapter: 1 ID: 0
Read mode : Secure
Utilize accurate stream : Yes
for /r %i in (*.mkv) do (ffmpeg -i "%i" -vf "fps=12,setpts=0.25*PTS,scale=720:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 %~ni.gif)
REM ----------------------------------------------------------------------------------------------------------
REM ### Apps and app suggestions
REM ----------------------------------------------------------------------------------------------------------
REM TITLE: Turn Off Automatic Installation of Suggested Apps in Windows 10
REM LINK: https://www.tenforums.com/tutorials/68217-turn-off-automatic-installation-suggested-apps-windows-10-a.html
REM OPTIONS: 0x00000001=On, 0x00000000=Off
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /V "SilentInstalledAppsEnabled" /T "REG_DWORD" /D "0x00000000" /F 1>NUL 2>&1
REM TITLE: Turn Off Suggested Content Settings App Windows 10 Turn Off Suggested Content In Settings

Some handy MKVToolNix commands

Extract chapter XML files for all MKVs:

for /r %i in (*.mkv) do (mkvextract "%i" chapters "%~ni".xml)

Remove all chapters from MKVs:

for /r %i in (*.mkv) do (mkvpropedit "%i" --chapters "")
@ScribbleGhost
ScribbleGhost / subtitle_extractor.bat
Last active January 26, 2023 03:24
Extract all subtitles from MKV video file, and make a copy of the video file without subtitles. Requires mkvmerge and subtitleedit CLI in PATH
@echo off
FOR %%A IN (*.mkv) DO (
echo %%~nxA
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "SubRip"') DO (IF %%I GTR 0 (echo SRT found in file) & (subtitleedit /convert "%%A" SubRip) else (echo SRT not found in file))
echo.&echo.
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "SubStationAlpha"') DO (IF %%I GTR 0 (echo ASS found in file) & (subtitleedit /convert "%%A" SubStationAlpha) else (echo ASS not found in file))
echo.&echo.
FOR /F %%I IN ('mkvmerge -i "%%A" ^| FIND /C "VobSub"') DO (IF %%I GTR 0 (echo. &echo. &echo. &echo. & echo VobSub - SUB/IDX found in file. You should use SubtitleEdit to convert the subtitles to a text-based format such as SRT) else (echo VobSub not found in file))
echo.&echo.
@ScribbleGhost
ScribbleGhost / Check a video file for subtitles, subtitle language and subtitle format
Created April 12, 2021 12:47
Check a video file for subtitles, subtitle language and subtitle format with ffprobe
ffprobe -loglevel error -select_streams s -show_entries stream=codec_name,index:stream_tags=language -of csv=p=0 %input%
@ScribbleGhost
ScribbleGhost / Getting file names in a batch script.md
Created April 11, 2021 14:48
How to print file names with and without extensions in a Windows batch script. With relative or full path.

Getting file names in a batch script

Remember:

  • Replace double precentages with single precentage if you want to use it in CMD directly.
  • When file names are printed out, they already include double quotes.
@echo off
@ScribbleGhost
ScribbleGhost / List all file types in a folder.ps1
Last active January 30, 2024 14:11
Get number of different file types in a given folder (including sub folders) with PowerShell
Get-Childitem -Recurse | where { -not $_.PSIsContainer } | group Extension -NoElement | sort count -desc
ffmpeg -i input.vtt -f srt output.srt

Finding files by their size in PowerShell

Find the 10 largest files in a directory and convert bytes to GB:

gci "M:\VIDEO" -Recurse -File | sort length -descending | select -first 10 fullname, @{Name="Gigabytes";Expression={[Math]::round($_.length / 1GB, 2)}} | Out-GridView