BrianDMG/conv2mp4
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.
📋 Changes
- webUI is now responsive, and readable on large or small screens
- Added current configuration section
- Added ability to check for updates
- Will unobtrusively notify in both the log output and the webUI
- Notifications can be disabled in configuration (see new config template in files/cfg/config.yaml)
- Fixed a bug where apostrophes and certain grave accents were being interpreted as single quotes, causing files whose names contained those characters to be reported as corrupt
📋 Changes
- New features in v5.0.0:
- Docker container
- WebUI for monitoring
- Schedule script executions with cron syntax
- Persistent usage statistics (over time)
- Split logging for easier readability
- Log rotation
- Bug fixes
📋 Changes
- Improved metadata parsing
- Bug fixes
- Closes #67
- Closes #68
- Closes #70
📋 Changes
- Fixed minor issue where failover threhold percentage was not being dynamically generated, leading to possibly incorrect messaging in the console and log.
📋 Changes
- Closes #58
- Using out_path now preserves media_path directory structure in the out_path.
- Using out_path will now delete empty directories in the media_path, but will not delete the media_path itself (this avoids leaving behind a bunch of empty directories for files that were successfully converted and moved to out_path). This will leave directories containing failed conversions or corrupt files untouched in media_path for manual troubleshooting.
- The out_path directory is now validated in the pre-flight script, with proper error logging.
📋 Changes
- Fixed bug with forced stereo audio track cloning (#54)
- Improved metadata title parsing
- Plex library no longer refreshes on "compliant mp4" condition, should save some CPU cycles
- Moov atom now always moved to the beginning of the file for quicker streaming (*more info can be found @ https://www.adobe.com/devnet/video/articles/mp4_movie_atom.html for the curious*)
- Fixed progress bar counter during interactive file discovery process
- Various minor code improvements
📦 Release v4.0
- Release v4.0 is a major code overhaul that introduces the following new features and improvements:
✨ New features
- Ignore list: shortens time required to find new files on script execution by excluding files the script has already successfully processed
- Clone audio to stereo track: Addresses #42 - when enabled, will create a stereo copy of any non-stereo audio tracks for each file for playback on stereo systems (while retaining the original audio track)
- Metadata title: Sets the file's metadata title to the filename (helps with Plex matching) [thanks to @djgrijalva]
- User-defined failover threshold: User can now define the failover threshold to any desired percentage (Addresses #38)
- Failed encoding reporting: List files that failed to encode (even after failover) in the log
- Corrupt file reporting: List corrupt files in the log (files with either corrupt video or audio codecs)
📦 Improvements
- Configuration: Configuration is now set by the user in a plain text file
- Code enhancement: Code is now modular, increasing readability and ease of adding new features
- Portability: Pulling the latest version of the code will not overwrite or otherwise change any user settings in the config file
- Validation: All user-defined settings in the config file are validated prior to the script executing. Any errors will cause the script to log a relevant message and exit.
- Timekeeping: Fixed various issues with timekeeping in the script, resulting in more accurate statistics
- Best practices: Various changes to conform to Powershell best practices
📋 Changes
- New method of calculating per-encode and cumulative disk usage change
- Calculated values are more accurate now - using a 1024 base
- Closes issue #27
- Removed unnecessary whitespace
📋 Changes
- Addressed Issue #19 : Added a toggle for Plex features so it can be
- Addressed Issue #22 : Special characters in file names are ignored and
- Added a description for each ffmpeg and HandbrakeCLI argument within
- Since an option was added to the cfg file, make sure you don't delete
📋 Changes
- Feature: Script and configuration are now separate. This allows for
- Feature: New option to enable/disable keeping subtitles. (*addressed
- Feature: New option to allow for a separate output path. (*feature
- Behavior: Script now explicitly deletes MKVs when an identical MP4 (*same
- Behavior: When run manually, script gives live update of how many files have been
📋 Changes
- Addressed issue #10 - "Request - Queuing" - If script is already
📋 Changes
- New functionality including an interactive configuration utility that tests user input to ensure variables are valid
- Variables now stored in configuration file so the user never has to directly edit any script
- Configuration file can still be edited manually
📋 Changes
- New feature - Added switch to allow the user to decide whether new session logs overwrite old session logs or are appended to old session logs (issue #5).
- Fixed issue #6 - Fixed an error where the correct file size for new files generated after a Handbrake encode was not being properly reported, causing Handbrake encoded files to be deleted regardless of success or failure.
📋 Changes
- Added test to ensure user-defined paths are valid, with friendly
- Added check for file sizes to allow for representing sizes as KB, MB,
- Implemented error handling that should prevent data loss due to source
- Improved exception handling to allow the script to fail gracefully
📋 Changes
- Script now retains all audio and subtitle channels with both ffmpeg and Handbrake
- Handbrake failover settings tweaked - now finishes in a sane amount of time with little noticeable quality loss
- Script now double checks whether the source file was deleted, and if not tries to delete it again
- Added .ts files to the default list of filetype extensions
📋 Changes
- Handbrake failover forces x264 v4.0 for increased compatibility with streaming clients (thanks for the suggestion /u/SwiftPanda16)
- Plex library refresh no longer opens a browser (thanks to /u/Plonqor)
📦 Release v1.2
- Grouped all user-defined variables at the beginning of the script for ease of use
- Fixed timestamp refresh issue in log
- Added size difference (in MB) between the old file and the newly converted file in log
- Added functionality to fail over to Handbrake encoding when an ffmpeg conversion fails
- Added user instructions in comments
This Powershell script will recursively search through a defined file path and convert all MKV, AVI, FLV, and MPEG files to MP4 using ffmpeg (and converts audio channels to AAC). It then refreshes a Plex library, and upon conversion success deletes the source (original) file. The purpose of this script is to reduce the number of transcodes performed by a Plex server. This release introduced greater portability and ease-of-use by moving most user-defined variables to the beginning of the script.
This script recursively searches through a defined path and converts all files to mp4 using ffmpeg. It then refreshes your Plex library and deletes the old file.
