forked from 0x2620/pandora
only extract keyframe index for video files
This commit is contained in:
parent
466c85190f
commit
01f32871fd
2 changed files with 4 additions and 2 deletions
|
@ -352,7 +352,8 @@ def stream(video, target, profile, info, audio_track=0, flags={}):
|
|||
shutil.move(enc_target, target)
|
||||
for f in glob('%s.log*' % target):
|
||||
os.unlink(f)
|
||||
make_keyframe_index(target)
|
||||
if info['video']:
|
||||
make_keyframe_index(target)
|
||||
return True, None
|
||||
|
||||
|
||||
|
|
|
@ -370,7 +370,8 @@ class File(models.Model):
|
|||
self.info.update(stream.info)
|
||||
self.parse_info()
|
||||
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 save_chunk(stream, stream.media, chunk, offset, name, done_cb)
|
||||
return False, 0
|
||||
|
|
Loading…
Reference in a new issue