Skip to content
Python script for automatic converts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
ntfsutils
LICENSE
README.md
conv2mp4-py.py
conv2mp4-server.py
sync.py

README.md

DEPRECATED

THIS PROJECT IS NO LONGER BEING MAINTAINED OR UPDATED WITH FRESH COMMITS:

conv2mp4-py

Python 2.7 script that recursively searches through a defined file path and converts MKV, AVI, FLV, and MPEG files to MP4 using handbrake (with AAC audio). It then refreshes a Plex library, and deletes the source file upon success and moves the new files into the defines directory (Plex Library directories for example). Fails over to ffmpeg encode if conversion failure is detected. The purpose of this script is to reduce the number of transcodes performed by a Plex server, by processing all files into an MP4 format.

Dependencies
This script requires Python, Filebot, ffmpeg and Handbrake to be installed on your computer. You can download them from here:
Python
FileBot
ffmpeg
Handbrake

Usage
You need to launch either with the bundled launcher script or manually from a commandline: There is only one argument: the path to the media files

User-defined variables
There are several user-defined variables you will need to edit using notepad or a program like Notepad++.

NOTE: to use a mapped drive, you must run net use z: \server\share /persistent:yes as the user you're going to run the script as (generally Administrator) prior to running the script.

FFMPEG = path to ffmpeg.exe
HANDBRAKE = path to HandBrakeCLI.exe
FILEBOT = path to FileBot.exe
MEDIA_PATH = Path to your uncoverted media

ENABLE_PLEX_UPDATE Set to True to enable the script to update your server
NOTE: Requires PLEX_IP and PLEX_TOKEN to work.
PLEX_IP = the IP address and port of your Plex server (for the purpose of refreshing its library)
PLEX_TOKEN = your Plex server's token (for the purpose of refreshing its library).
NOTE: See https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token for instructions on retrieving your Plex server's token. Your Plex server's token is also easy to retrieve with Couchpotato or SickRage.

MAX_CONVERT_ITEMS = Maximum number of files to convert in one go
LOCALE = Three digit code for your language for example for Hungarian it's 'hun'

Target Folders for converted files
MOVIE_TARGET = Path where you want your movies
TVSHOW_TARGET = Path where you want your TV SHows
LANG_MOVIE_TARGET = Path where you want your foreign language movies
LANG_TVSHOW_TARGET = Path where you want your foreign langue Tv Shows

FOREIGN = Set to true if you want the script to take foreign language into account
EXTRACT_SRT = Whether to extract the subtitles from files into external SRTs (External SRT files don't trigger transcoding, while embedded might)

REMOVE_OLD = Whether to remove the files that have been already converted and are no longer needed

You can’t perform that action at this time.