Last active
March 2, 2023 20:20
-
-
Save martinbowling/b54c1e7eb31cd62c6376a781fc6a4455 to your computer and use it in GitHub Desktop.
AVI to MP4
This file contains 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 | |
set input_folder=C:\path\to\avi\files | |
if not exist "%input_folder%\converted" mkdir "%input_folder%\converted" | |
for %%f in ("%input_folder%\*.avi") do ( | |
ffmpeg -i "%%f" -c:v libx264 -c:a aac -b:a 192k "%input_folder%\converted\%%~nf.mp4" | |
move "%%f" "%input_folder%\converted" | |
) | |
echo Conversion complete. |
This file contains 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
#!/bin/bash | |
# Specify the folder containing the .avi files | |
input_folder="/path/to/avi/files" | |
# Create the subfolder for the converted files if it doesn't exist | |
if [ ! -d "${input_folder}/converted" ]; then | |
mkdir "${input_folder}/converted" | |
fi | |
# Convert each .avi file to .mp4 and move it to the subfolder | |
for file in "${input_folder}"/*.avi; do | |
if [ -f "$file" ]; then | |
ffmpeg -i "$file" -c:v libx264 -c:a aac -b:a 192k "${input_folder}/converted/$(basename "${file/.avi/.mp4}")" | |
mv "$file" "${input_folder}/converted" | |
fi | |
done | |
echo "Conversion complete." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment