This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified file types to MP4 with H264 video and AAC audio using ffmpeg. The purpose of this script is to reduce transcoding CPU load on a media server like Plex or Emby and increase video compatibility across platforms.
Removed extra If statement for "file" vs "files" and replaced with "file(s)" to accommodate both
Refactored encoding functions into a single function (ConvertToNewMP4) to reduce repetitive code and handle more advanced ffmpeg options (like Issue #16 & #21). One function to rule them all!
Added $setTitle config variable to add title metadata. Helps with Plex naming. This possible due to refactored encoding function
Moved functions to the top of the script per PowerShell standard convention