Skip to content

Instantly share code, notes, and snippets.

@lightsongjs
Created December 3, 2024 09:10
Show Gist options
  • Save lightsongjs/55241af63761ddfa820e32c7ca0d81de to your computer and use it in GitHub Desktop.
Save lightsongjs/55241af63761ddfa820e32c7ca0d81de to your computer and use it in GitHub Desktop.
converts all .mkv files in the current directory to .mp4
@echo off
:: This script converts all .mkv files in the current directory to .mp4 format
:: using ffmpeg. Make sure ffmpeg is installed and available in the system PATH.
setlocal enabledelayedexpansion
:: Loop through all .mkv files in the current directory
for %%f in (*.mkv) do (
:: Set the base name by removing the file extension
set "basename=%%~nf"
echo Converting "!basename!.mkv" to "!basename!.mp4"
:: Call ffmpeg to convert the file
ffmpeg -i "%%f" -c:v copy -c:a copy "!basename!.mp4"
)
echo All conversions are complete.
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment