From 3e14f111d44d76c644cb250bb2fe94cc47083ae3 Mon Sep 17 00:00:00 2001 From: yurygoru Date: Fri, 1 Nov 2019 07:40:13 +0000 Subject: [PATCH] fix problem with last frame --- cvat/apps/engine/media_extractors.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cvat/apps/engine/media_extractors.py b/cvat/apps/engine/media_extractors.py index d3aa21dfecfe..bcc2886784d6 100644 --- a/cvat/apps/engine/media_extractors.py +++ b/cvat/apps/engine/media_extractors.py @@ -233,14 +233,13 @@ def save_image(self, k, dest_path): def save_as_chunks(self, chunk_size, task, progress_callback=None): if not self._source_path: raise Exception('No data to compress') - for i in range(math.ceil(len(self._source_path) / chunk_size)): start_frame = i * chunk_size input_images = os.path.join(self._tmp_dir, self._imagename_pattern) input_options = '-f image2 -framerate 25 -start_number {}'.format(start_frame) output_chunk = task.get_chunk_path(i) self.prepare_dirs(output_chunk) - output_options = '-vframes {} -codec:v mpeg1video -q:v 0'.format(chunk_size) + output_options = '-vframes {} -f mpegts -c:a none -codec:v mpeg1video -bf 0 -b:v 800k'.format(chunk_size) ff = FFmpeg( inputs = {input_images: input_options},