This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | @echo off | |
| REM Script purpose: batch convert all .mp4 files to H.264 (libx264) and save to output\ with suffix _h264 | |
| REM Create output directory (safe if it already exists) | |
| mkdir output | |
| REM Loop over all mp4 files in the current directory | |
| for %%a in (*.mp4) do ( | |
| REM Re-encode video to H.264 with CRF 23 and medium preset; copy audio stream unchanged | |
| REM Input: "%%a" Output: "output\%%~na_h264.mp4" | |
| ffmpeg -i "%%a" -c:v libx264 -crf 23 -preset medium -c:a copy "output\%%~na_h264.mp4" | |
| ) |