Last active
June 12, 2024 13:40
-
-
Save sergiobd/95403ea3087373b661c3b72b59d75eb0 to your computer and use it in GitHub Desktop.
Batch convert videos using ffmpeg and powershell
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
# Script to convert a list of files using ffmpeg and powershell. This example converts to .ogv files (theora/vorbis as video/audio codecs) | |
# Please note that, if you havent done so, you should set the execution policy of powershell in order to be able to run this script. | |
# The easiest way to run this script without messing to much with execution policies is to set it for a single powershell session: | |
# powershell.exe -ExecutionPolicy Unrestricted | |
# Check: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies | |
$filenames = "1","2", "3", "4", "5","6","7" | |
$filepath = "C:\Users\Oculus\Documents\Videos\Menu\" | |
$extension = ".mp4" | |
ForEach( $file in $filenames){ | |
#Convert using ffmpeg | |
ffmpeg -i $filepath$file$extension -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 $filepath$file.ogv | |
} |
Glad you found it useful!!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Created an account just to say Thank You!
This bit of code was just what I needed to start batch encoding. 😊