|
|
|
|
@ -320,6 +320,13 @@ class MediaDescriptor:
|
|
|
|
|
if s.getType() == TrackType.SUBTITLE
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
def getAttachmentTracks(self) -> List[TrackDescriptor]:
|
|
|
|
|
return [
|
|
|
|
|
s
|
|
|
|
|
for s in self.__trackDescriptors
|
|
|
|
|
if s.getType() == TrackType.ATTACHMENT
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def getImportFileTokens(self, use_sub_index: bool = True):
|
|
|
|
|
"""Generate ffmpeg import options for external stream files"""
|
|
|
|
|
@ -366,12 +373,14 @@ class MediaDescriptor:
|
|
|
|
|
stdsi = sortedTrackDescriptors[td.getSourceIndex()].getSubIndex()
|
|
|
|
|
|
|
|
|
|
trackType = td.getType()
|
|
|
|
|
trackCodec = td.getCodec()
|
|
|
|
|
|
|
|
|
|
if (trackType == TrackType.VIDEO or not only_video):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
importedFilePath = td.getExternalSourceFilePath()
|
|
|
|
|
|
|
|
|
|
if use_sub_index:
|
|
|
|
|
if use_sub_index and not (trackType == TrackType.ATTACHMENT and trackCodec == TrackCodec.TTF):
|
|
|
|
|
|
|
|
|
|
if importedFilePath:
|
|
|
|
|
|
|
|
|
|
@ -383,16 +392,17 @@ class MediaDescriptor:
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
|
|
if not td.getCodec() in [TrackCodec.PGS, TrackCodec.VOBSUB]:
|
|
|
|
|
if not trackCodec in [TrackCodec.PGS, TrackCodec.VOBSUB]:
|
|
|
|
|
inputMappingTokens += [
|
|
|
|
|
"-map",
|
|
|
|
|
f"0:{trackType.indicator()}:{stdsi}",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
if not td.getCodec() in [TrackCodec.PGS, TrackCodec.VOBSUB]:
|
|
|
|
|
if not trackCodec in [TrackCodec.PGS, TrackCodec.VOBSUB]:
|
|
|
|
|
inputMappingTokens += ["-map", f"0:{stdi}"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return inputMappingTokens
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|