Skip to content

Instantly share code, notes, and snippets.

@mianala
Created May 31, 2023 06:25
Show Gist options
  • Save mianala/53806947ad014b2b1859a6e54a9b53ad to your computer and use it in GitHub Desktop.
Save mianala/53806947ad014b2b1859a6e54a9b53ad to your computer and use it in GitHub Desktop.
@echo off
REM Get input file and base name
set input_file=%1
for %%I in ("%input_file%") do set base_name=%%~nI
REM Define output files
set output_file_mp4="%base_name%.mp4"
set output_file_normalized="%base_name%_normalized.mp4"
set output_file_spedup="%base_name%_spedup.mp4"
REM Convert to MP4
ffmpeg -i %input_file% -c:v libx264 -c:a aac %output_file_mp4%
REM Normalize audio
ffmpeg -i %output_file_mp4% -af loudnorm=I=-16:LRA=11:TP=-1.5 %output_file_normalized%
REM Speed up video and audio by 1.2
ffmpeg -i %output_file_normalized% -filter_complex "[0:v]setpts=0.8333*PTS[v];[0:a]atempo=1.2[a]" -map "[v]" -map "[a]" %output_file_spedup%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment