Try this code on PC run as *.cmd or *.bat file:
mkdir mp4
mkdir orig
FOR /F "tokens=*" %%G IN ('dir /b "*.mp4"') DO (ffmpeg -y -i "%%G" -f mp4 -vcodec libx264 -preset slow -crf 20 -movflags +faststart -profile:v high -pix_fmt yuv420p -g 1 -bf 0 -flags +cgop -x264-params keyint=1:min-keyint=1 -acodec aac -ac 2 -ab 128k -ar 48000 -async 1 "mp4\%%~nG.mp4" -c:a pcm_s16le "mp4\%%~nG.wav" & move "%%G" orig\)
pause
You should start this script file in same folder with your video files.
This code create 2 folders for encoded files and for original files, make transcoded video file and audio in "mp4" folder, and remove original file to "orig" folder.
You can use [-an] instead [-acodec aac -ac 2 -ab 128k -ar 48000 -async 1 ] , and change ["*.mp4"] to other input format.
Also, you can change video quality by changing [-crf] value.