only extract keyframe index for video files

This commit is contained in:
j 2018-12-23 14:11:22 +01:00
parent 466c85190f
commit 01f32871fd
2 changed files with 4 additions and 2 deletions

View file

@ -352,7 +352,8 @@ def stream(video, target, profile, info, audio_track=0, flags={}):
shutil.move(enc_target, target) shutil.move(enc_target, target)
for f in glob('%s.log*' % target): for f in glob('%s.log*' % target):
os.unlink(f) os.unlink(f)
make_keyframe_index(target) if info['video']:
make_keyframe_index(target)
return True, None return True, None

View file

@ -370,7 +370,8 @@ class File(models.Model):
self.info.update(stream.info) self.info.update(stream.info)
self.parse_info() self.parse_info()
self.save() self.save()
extract.make_keyframe_index(stream.media.path) if stream.info.get('video'):
extract.make_keyframe_index(stream.media.path)
return True, stream.media.size return True, stream.media.size
return save_chunk(stream, stream.media, chunk, offset, name, done_cb) return save_chunk(stream, stream.media, chunk, offset, name, done_cb)
return False, 0 return False, 0