|
|
@ -302,6 +302,11 @@ class FFmpegPostProcessor(PostProcessor):
|
|
|
|
None)
|
|
|
|
None)
|
|
|
|
return num, len(streams)
|
|
|
|
return num, len(streams)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _fixup_chapters(self, info):
|
|
|
|
|
|
|
|
last_chapter = traverse_obj(info, ('chapters', -1))
|
|
|
|
|
|
|
|
if last_chapter and not last_chapter.get('end_time'):
|
|
|
|
|
|
|
|
last_chapter['end_time'] = self._get_real_video_duration(info['filepath'])
|
|
|
|
|
|
|
|
|
|
|
|
def _get_real_video_duration(self, filepath, fatal=True):
|
|
|
|
def _get_real_video_duration(self, filepath, fatal=True):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
duration = float_or_none(
|
|
|
|
duration = float_or_none(
|
|
|
@ -678,6 +683,7 @@ class FFmpegMetadataPP(FFmpegPostProcessor):
|
|
|
|
|
|
|
|
|
|
|
|
@PostProcessor._restrict_to(images=False)
|
|
|
|
@PostProcessor._restrict_to(images=False)
|
|
|
|
def run(self, info):
|
|
|
|
def run(self, info):
|
|
|
|
|
|
|
|
self._fixup_chapters(info)
|
|
|
|
filename, metadata_filename = info['filepath'], None
|
|
|
|
filename, metadata_filename = info['filepath'], None
|
|
|
|
files_to_delete, options = [], []
|
|
|
|
files_to_delete, options = [], []
|
|
|
|
if self._add_chapters and info.get('chapters'):
|
|
|
|
if self._add_chapters and info.get('chapters'):
|
|
|
@ -1040,6 +1046,7 @@ class FFmpegSplitChaptersPP(FFmpegPostProcessor):
|
|
|
|
|
|
|
|
|
|
|
|
@PostProcessor._restrict_to(images=False)
|
|
|
|
@PostProcessor._restrict_to(images=False)
|
|
|
|
def run(self, info):
|
|
|
|
def run(self, info):
|
|
|
|
|
|
|
|
self._fixup_chapters(info)
|
|
|
|
chapters = info.get('chapters') or []
|
|
|
|
chapters = info.get('chapters') or []
|
|
|
|
if not chapters:
|
|
|
|
if not chapters:
|
|
|
|
self.to_screen('Chapter information is unavailable')
|
|
|
|
self.to_screen('Chapter information is unavailable')
|
|
|
|