diff --git a/autoProcessMedia.cfg.spec b/autoProcessMedia.cfg.spec index 5a0768b0..0d026410 100644 --- a/autoProcessMedia.cfg.spec +++ b/autoProcessMedia.cfg.spec @@ -278,7 +278,7 @@ externalSubDir = # outputDefault. Loads default configs for the selected device. The remaining options below are ignored. # 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 profiles allowed: iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, xbox, Roku-1080p, Roku-720p, Roku-480p outputDefault = # hwAccel. 1 will set ffmpeg to enable hardware acceleration (this requires a recent ffmpeg) hwAccel = 0 @@ -287,6 +287,7 @@ outputVideoCodec = libx264 VideoCodecAllow = outputVideoPreset = medium + outputVideoResolution = 1920:1080 outputVideoFramerate = 24 outputVideoBitrate = 800000 outputAudioCodec = ac3 diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index ade62778..74bfb7cf 100755 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -189,7 +189,7 @@ # externalSubDir. set the directory where subs should be saved (if not the same directory as the video) #externalSubDir= -# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p). +# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, xbox, Roku-1080p, Roku-720p, Roku-480p). # # outputDefault. Loads default configs for the selected device. The remaining options below are ignored. # If you want to use your own profile, set None and set the remaining options below. diff --git a/nzbToMedia.py b/nzbToMedia.py index be837c09..39500c5f 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -385,7 +385,7 @@ # externalSubDir. set the directory where subs should be saved (if not the same directory as the video) #externalSubDir= -# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p). +# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, xbox, Roku-1080p, Roku-720p, Roku-480p). # # outputDefault. Loads default configs for the selected device. The remaining options below are ignored. # If you want to use your own profile, set None and set the remaining options below. diff --git a/nzbToNzbDrone.py b/nzbToNzbDrone.py index e8c5e526..6e5333a5 100755 --- a/nzbToNzbDrone.py +++ b/nzbToNzbDrone.py @@ -179,7 +179,7 @@ # externalSubDir. set the directory where subs should be saved (if not the same directory as the video) #externalSubDir = -# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p). +# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, xbox, Roku-1080p, Roku-720p, Roku-480p). # # outputDefault. Loads default configs for the selected device. The remaining options below are ignored. # If you want to use your own profile, set None and set the remaining options below. diff --git a/nzbToSickBeard.py b/nzbToSickBeard.py index 3479c4c8..d916739f 100755 --- a/nzbToSickBeard.py +++ b/nzbToSickBeard.py @@ -197,7 +197,7 @@ # externalSubDir. set the directory where subs should be saved (if not the same directory as the video) #externalSubDir= -# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, Roku-1080p, Roku-720p, Roku-480p). +# outputDefault (None, iPad, iPad-1080p, iPad-720p, Apple-TV2, iPod, iPhone, PS3, xbox, Roku-1080p, Roku-720p, Roku-480p). # # outputDefault. Loads default configs for the selected device. The remaining options below are ignored. # If you want to use your own profile, set None and set the remaining options below. diff --git a/nzbtomedia/__init__.py b/nzbtomedia/__init__.py index 56348961..ca42d3d2 100644 --- a/nzbtomedia/__init__.py +++ b/nzbtomedia/__init__.py @@ -491,6 +491,14 @@ def initialize(section=None): 'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None, 'SCODEC':'mov_text' }, + 'xbox':{ + 'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None, + 'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'], + 'ACODEC':'ac3','ACODEC_ALLOW':['ac3'],'ABITRATE':None, 'ACHANNELS':6, + 'ACODEC2':None,'ACODEC2_ALLOW':[],'ABITRATE2':None, 'ACHANNELS2':None, + 'ACODEC3':None,'ACODEC3_ALLOW':[],'ABITRATE3':None, 'ACHANNELS3':None, + 'SCODEC':'mov_text' + }, 'Roku-480p':{ 'VEXTENSION':'.mp4','VCODEC':'libx264','VPRESET':None,'VFRAMERATE':None,'VBITRATE':None, 'VRESOLUTION':None,'VCODEC_ALLOW':['libx264', 'h264', 'h.264', 'AVC', 'avc', 'mpeg4', 'msmpeg4', 'MPEG-4'], diff --git a/nzbtomedia/transcoder/transcoder.py b/nzbtomedia/transcoder/transcoder.py index 99d09c4d..a6b386f0 100644 --- a/nzbtomedia/transcoder/transcoder.py +++ b/nzbtomedia/transcoder/transcoder.py @@ -6,6 +6,7 @@ import urllib2 import traceback import nzbtomedia import json +import shutil from subprocess import call from nzbtomedia import logger from nzbtomedia.nzbToMediaUtil import makeDir @@ -393,7 +394,10 @@ def extract_subs(file, newfilePath, bitbucket): subdir = os.path.split(newfilePath)[0] name = os.path.splitext(os.path.split(newfilePath)[1])[0] - subStreams = [item for item in video_details["streams"] if item["codec_type"] == "subtitle" and item["tags"]["language"] in nzbtomedia.SLANGUAGES and item["codec_name"] != "hdmv_pgs_subtitle"] + try: + subStreams = [item for item in video_details["streams"] if item["codec_type"] == "subtitle" and item["tags"]["language"] in nzbtomedia.SLANGUAGES and item["codec_name"] != "hdmv_pgs_subtitle"] + except: + subStreams = [item for item in video_details["streams"] if item["codec_type"] == "subtitle" and item["codec_name"] != "hdmv_pgs_subtitle"] num = len(subStreams) for n in range(num): sub = subStreams[n] @@ -424,9 +428,12 @@ def extract_subs(file, newfilePath, bitbucket): logger.error("Extracting subtitle has failed") if result == 0: + try: + shutil.copymode(file, outputFile) + except: pass logger.info("Extracting %s subtitle from %s has succeeded" % (lan, file)) else: - logger.error("Extracting subtitles has failed") + logger.error("Extracting subtitles has failed") def Transcode_directory(dirName): if platform.system() == 'Windows': @@ -482,6 +489,9 @@ def Transcode_directory(dirName): logger.error("Transcoding of video %s has failed" % (file)) if result == 0: + try: + shutil.copymode(file, newfilePath) + except: pass logger.info("Transcoding of video %s to %s succeeded" % (file, newfilePath)) if not nzbtomedia.DUPLICATE and os.path.isfile(newfilePath): # we get rid of the original file os.unlink(file)