slyfox1186

Convert Video from x264 to x265 HEVC using ffmpeg.exe Win10

Jan 2nd, 2020
470
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 0.94 KB | None | 0 0
  1. :: convert x264 mp4 file to x264 using ffmpeg.exe and x265.exe
  2. :: original file will be left in tact and the new output
  3. :: file will have (x265) added to the end of the filename
  4.  
  5. @echo off
  6. setlocal enabledelayedexpansion
  7. prompt $g
  8. color 0a
  9.  
  10. pushd "%~dp0"
  11.  
  12. :: Define ffmpeg.exe variable
  13. set FF=C:\MAB\local64\bin-video\ffmpeg.exe
  14.  
  15. :: Define x265 preset vars for use as needed
  16. set VF=-preset veryfast
  17. set F=-preset fast
  18. set M=-preset medium
  19. set S=-preset slow
  20. set SL=-preset slower
  21.  
  22. :: Find mp4 file and run ffmpeg
  23. :: Output file will add (x265) in the file name
  24. for %%G in (*.mp4) do (
  25. set fname="%%~nxG"
  26. set fout="%%~nG(x265).mp4"
  27. call :runFF !fname! !fout!
  28. pause
  29. goto:eof
  30. )
  31.  
  32. :: Run ffmpeg.exe using found mp4 file
  33. :runFF
  34. %FF% ^
  35. -stats ^
  36. -hide_banner ^
  37. -y ^
  38. -i "%~1" ^
  39. -c:v libx265 %VF% -crf 22 -vf scale=1920:-1 ^
  40. -c:a copy ^
  41. "%~2"
  42. exit /b
  43.  
  44. :: Miscellaneous
  45. :: -ss 00:00:23 ^
  46. :: -ss 230 ^
  47. :: -to 00:31:17 ^
  48. :: -t 119 ^
Add Comment
Please, Sign In to add comment