Created
July 9, 2023 14:06
-
-
Save qant/5c5b8344e84aebfca1c050f40a990305 to your computer and use it in GitHub Desktop.
ffmpeg bulk video decoder
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
<?php | |
$inputFolder = '/path'; | |
$outputFolder = '/path_output'; | |
$files = glob($inputFolder . '/*'); | |
foreach ($files as $file) { | |
$filename = pathinfo($file, PATHINFO_FILENAME); | |
$command = "ffmpeg -i \"$file\" -vf \"scale=-1:720\" -crf 23 -preset medium -c:v libx264 -c:a aac -b:a 128k \"$outputFolder/$filename.mkv\""; | |
exec($command); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment