Skip to content

Instantly share code, notes, and snippets.

@Snugglepantz
Last active February 17, 2016 17:50
Show Gist options
  • Save Snugglepantz/8a09bafcda80de6abd37 to your computer and use it in GitHub Desktop.
Save Snugglepantz/8a09bafcda80de6abd37 to your computer and use it in GitHub Desktop.
x265 ffmpeg
FOR /F "tokens=*" %%G IN ('dir /b *.mp4') DO ffmpeg -i "%%G" -c:v libx265 -preset medium -x265-params crf=28 -c:a aac -strict -2 -b:a 128k "%%~nG.mkv"
@echo off
REM keep a counter for files converted
set /A nfile=0
REM do not copy empty folders or any files
@echo Copying directory structure from %0 to %1 ...
xcopy /T %1 %2
REM walk directory structure and convert each file in quiet mode
for /R %1 %%v in (*.mp4, *.mov, *.flv, *.wmv) do (
echo converting "%%~nxv" ...
ffmpeg -i "%%v" -c:v libx265 -preset medium -x265-params crf=28 -c:a aac -strict -2 -b:a 128k "%%~dpnv.mkv"
set /A nfile+=1
)
echo Done! Converted %nfile% file(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment