I had a script that converts all mkvs in a folder to mp4s using ffmpeg. The downside is that it left the .mkv extension and just added .mp4 (eg: file.mkv.mkp4). I know %~n can be used to get a name without the extension, but I can't seem to figure it out.
Here's my original script:
for %%i IN (*.mkv) DO (ffmpeg -y -ss 00:00:00 -threads 6 -i "%%i" -vcodec copy -f mp4 -strict experimental -acodec aac -ab 128k -ac 2 "%%i.mp4")
Here's what I've tried:
for %%i IN (*.mkv) DO (ffmpeg -y -ss 00:00:00 -threads 6 -i "%~ni.mkv" -vcodec copy -f mp4 -strict experimental -acodec aac -ab 128k -ac 2 "%~ni.mp4")