Added few comments & fixed result spelling

This commit is contained in:
Moreno Sint Hill 2014-01-08 12:54:14 +01:00
parent c98604c618
commit 099e3056ee

View file

@ -72,7 +72,7 @@ def Transcode_directory(dirName):
outputVideoExtension = '-transcoded' + outputVideoExtension # adds '-transcoded.ext'
newfilePath = os.path.normpath(name + outputVideoExtension)
command = [ffmpeg, '-loglevel', 'warning', '-i', filePath, '-map', '0']
command = [ffmpeg, '-loglevel', 'warning', '-i', filePath, '-map', '0'] # -map 0 takes all input streams
if useNiceness:
command = ['nice', '-%d' % niceness] + command
@ -110,9 +110,9 @@ def Transcode_directory(dirName):
if outputQualityPercent > 0:
command.append('-q:a')
command.append(str(outputQualityPercent))
if len(outputSubtitleCodec) > 0:
if len(outputSubtitleCodec) > 0: # Not every subtitle codec can be used for every video container format!
command.append('-c:s')
command.append(outputSubtitleCodec)
command.append(outputSubtitleCodec) # http://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options
else:
command.append('-sn') # Don't copy the subtitles over
command.append(newfilePath)
@ -136,11 +136,11 @@ def Transcode_directory(dirName):
except:
Logger.exception("Transcoding of video %s has failed", filePath)
if result == 0:
Logger.info("Transcoding of video %s to %s succeded", filePath, newfilePath)
Logger.info("Transcoding of video %s to %s succeeded", filePath, newfilePath)
if duplicate == 0: # we get rid of the original file
os.unlink(filePath)
else:
Logger.error("Transcoding of video %s to %s failed", filePath, newfilePath)
# this will be 0 (successful) it all are sucessful, else will return a positive integer for failure.
# this will be 0 (successful) it all are successful, else will return a positive integer for failure.
final_result = final_result + result
return final_result