mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-14 17:22:53 -07:00
Missing codecs no longer result in an error
This commit is contained in:
parent
9b94a86c72
commit
792e8b7876
1 changed files with 7 additions and 1 deletions
|
@ -61,13 +61,16 @@ def Transcode_directory(dirName):
|
||||||
outputVideoExtension = '-transcoded' + outputVideoExtension # adds '-transcoded.ext'
|
outputVideoExtension = '-transcoded' + outputVideoExtension # adds '-transcoded.ext'
|
||||||
newfilePath = os.path.normpath(name + outputVideoExtension)
|
newfilePath = os.path.normpath(name + outputVideoExtension)
|
||||||
|
|
||||||
command = [ffmpeg, '-i', filePath, '-map', '0']
|
command = [ffmpeg, '-i', filePath, '-map', '0', '-c:s', 'copy']
|
||||||
if outputVideoCodec:
|
if outputVideoCodec:
|
||||||
command.append('-c:v')
|
command.append('-c:v')
|
||||||
command.append(outputVideoCodec)
|
command.append(outputVideoCodec)
|
||||||
if outputVideoCodec == 'libx264' and outputVideoPreset:
|
if outputVideoCodec == 'libx264' and outputVideoPreset:
|
||||||
command.append('-preset')
|
command.append('-preset')
|
||||||
command.append(outputVideoPreset)
|
command.append(outputVideoPreset)
|
||||||
|
else:
|
||||||
|
command.append('-c:v')
|
||||||
|
command.append('copy')
|
||||||
if outputVideoFramerate:
|
if outputVideoFramerate:
|
||||||
command.append('-r')
|
command.append('-r')
|
||||||
command.append(outputVideoFramerate)
|
command.append(outputVideoFramerate)
|
||||||
|
@ -77,6 +80,9 @@ def Transcode_directory(dirName):
|
||||||
if outputAudioCodec:
|
if outputAudioCodec:
|
||||||
command.append('-c:a')
|
command.append('-c:a')
|
||||||
command.append(outputAudioCodec)
|
command.append(outputAudioCodec)
|
||||||
|
else:
|
||||||
|
command.append('-c:a')
|
||||||
|
command.append('copy')
|
||||||
if outputAudioBitrate:
|
if outputAudioBitrate:
|
||||||
command.append('-b:a')
|
command.append('-b:a')
|
||||||
command.append(outputAudioBitrate)
|
command.append(outputAudioBitrate)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue