GitPedia
BrianDMG

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.

19 Releases
Latest: 4y ago
v5.1.0Latest
BrianDMGBrianDMG·4y ago·September 18, 2021
GitHub

📋 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
v5.0.0
BrianDMGBrianDMG·4y ago·September 16, 2021
GitHub

📋 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
v4.2.0
BrianDMGBrianDMG·5y ago·August 4, 2020
GitHub

📋 Changes

  • Improved metadata parsing
  • Bug fixes
  • Closes #67
  • Closes #68
  • Closes #70
v4.1.2
BrianDMGBrianDMG·6y ago·April 27, 2020
GitHub

📋 Changes

  • Fixed minor issue where failover threhold percentage was not being dynamically generated, leading to possibly incorrect messaging in the console and log.
v4.1.1
BrianDMGBrianDMG·6y ago·March 12, 2020
GitHub

📋 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.
v4.1
BrianDMGBrianDMG·6y ago·February 14, 2020
GitHub

📋 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
v4.0
BrianDMGBrianDMG·6y ago·February 2, 2020
GitHub

📦 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
v3.1.2
BrianDMGBrianDMG·8y ago·October 25, 2017
GitHub

📋 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
v3.1
BrianDMGBrianDMG·8y ago·October 21, 2017
GitHub

📋 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
v3.0
BrianDMGBrianDMG·9y ago·June 10, 2017
GitHub

📋 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
v2.2
BrianDMGBrianDMG·9y ago·April 19, 2017
GitHub

📋 Changes

  • Addressed issue #10 - "Request - Queuing" - If script is already
v3.5-BETAPre-release
BrianDMGBrianDMG·9y ago·April 13, 2017
GitHub

📋 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
v2.1
BrianDMGBrianDMG·9y ago·April 12, 2017
GitHub

📋 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.
v2.0
BrianDMGBrianDMG·9y ago·March 31, 2017
GitHub

📋 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
v1.4
BrianDMGBrianDMG·9y ago·July 18, 2016
GitHub

📋 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
v1.3
BrianDMGBrianDMG·9y ago·July 13, 2016
GitHub

📋 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)
v1.2
BrianDMGBrianDMG·9y ago·July 5, 2016
GitHub

📦 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
v1.1
BrianDMGBrianDMG·9y ago·July 4, 2016
GitHub

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.

v1.0
BrianDMGBrianDMG·9y ago·July 4, 2016
GitHub

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.