diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index c80ae401..5a0768b0 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -280,6 +280,8 @@ # If you want to use your own profile, leave this blank and set the remaining options below. # outputDefault profiles allowed: iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p outputDefault = + # hwAccel. 1 will set ffmpeg to enable hardware acceleration (this requires a recent ffmpeg) + hwAccel = 0 #### Define custom settings below. outputVideoExtension = .mp4 outputVideoCodec = libx264 @@ -346,4 +348,4 @@ [passwords] # enter the full path to a text file containing passwords to be used for extraction attempts. # In the passwords file, every password should be on a new line - PassWordFile = \ No newline at end of file + PassWordFile = diff --git a/nzbtomedia/__init__.py b/nzbtomedia/__init__.py index 599f3c6d..56348961 100644 --- a/nzbtomedia/__init__.py +++ b/nzbtomedia/__init__.py @@ -165,6 +165,7 @@ FFMPEG = None FFPROBE = None CHECK_MEDIA = None NICENESS = [] +HWACCEL = False PASSWORDSFILE = None DOWNLOADINFO = None @@ -192,7 +193,7 @@ def initialize(section=None): DUPLICATE, IGNOREEXTENSIONS, VEXTENSION, OUTPUTVIDEOPATH, PROCESSOUTPUT, VCODEC, VCODEC_ALLOW, VPRESET, \ VFRAMERATE, LOG_DB, VBITRATE, VRESOLUTION, ALANGUAGE, AINCLUDE, ACODEC, ACODEC_ALLOW, ABITRATE, \ ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \ - SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, \ + SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, HWACCEL, \ NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \ DELETE_ORIGINAL, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \ USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, CHECK_MEDIA, SAFE_MODE, \ @@ -425,6 +426,7 @@ def initialize(section=None): SCODEC = CFG["Transcoder"]["outputSubtitleCodec"].strip() BURN = int(CFG["Transcoder"]["burnInSubtitle"].strip()) DEFAULTS = CFG["Transcoder"]["outputDefault"].strip() + HWACCEL = int(CFG["Transcoder"]["hwAccel"]) allow_subs = ['.mkv','.mp4', '.m4v', 'asf', 'wma', 'wmv'] codec_alias = { diff --git a/nzbtomedia/transcoder/transcoder.py b/nzbtomedia/transcoder/transcoder.py index 9e901470..cfbc7bba 100644 --- a/nzbtomedia/transcoder/transcoder.py +++ b/nzbtomedia/transcoder/transcoder.py @@ -347,7 +347,12 @@ def buildCommands(file, newDir): if nzbtomedia.OUTPUTFASTSTART: other_cmd.extend(['-movflags', '+faststart']) - command = [nzbtomedia.FFMPEG, '-loglevel', 'warning', '-i', file] + command = [nzbtomedia.FFMPEG, '-loglevel', 'warning'] + + if nzbtomedia.HWACCEL: + command.extend(['-hwaccel', 'auto']) + + command.extend([ '-i', file]) if nzbtomedia.SEMBED: filenum = 1