mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-06 21:21:12 -07:00
Fix subtitle extraction with multiple streams
Use the index position of the subtitle stream in the container, not in the array. It is not guaranteed that the array order or size is the same as in the container. This may be the case if we filtered out certain languages or hdmv_pgs_subtitle streams.
This commit is contained in:
parent
8d9d7cc298
commit
9d48e5e878
1 changed files with 2 additions and 1 deletions
|
@ -401,6 +401,7 @@ def extract_subs(file, newfilePath, bitbucket):
|
|||
num = len(subStreams)
|
||||
for n in range(num):
|
||||
sub = subStreams[n]
|
||||
idx = sub["index"]
|
||||
try:
|
||||
lan = sub["tags"]["language"]
|
||||
except:
|
||||
|
@ -415,7 +416,7 @@ def extract_subs(file, newfilePath, bitbucket):
|
|||
if os.path.isfile(outputFile):
|
||||
outputFile = os.path.join(subdir, "%s.%s.%s.srt" %(name, lan, n))
|
||||
|
||||
command = [nzbtomedia.FFMPEG, '-loglevel', 'warning', '-i', file, '-vn', '-an', '-codec:s:' + str(n), 'srt', outputFile]
|
||||
command = [nzbtomedia.FFMPEG, '-loglevel', 'warning', '-i', file, '-vn', '-an', '-codec:' + str(idx), 'srt', outputFile]
|
||||
if platform.system() != 'Windows':
|
||||
command = nzbtomedia.NICENESS + command
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue