diff --git a/CHANGELOG.md b/CHANGELOG.md index d91159ab0d24..b51110476ee8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - MOTS png mask format support () - Ability to correct upload video with a rotation record in the metadata () - User search field for assignee fields () +- Support of mxf videos () ### Changed diff --git a/cvat/apps/engine/media.mimetypes b/cvat/apps/engine/media.mimetypes index 48d16b55f7b8..a18d1ad574ac 100644 --- a/cvat/apps/engine/media.mimetypes +++ b/cvat/apps/engine/media.mimetypes @@ -61,6 +61,7 @@ video/mp2t m2t video/mp2t bdmv video/vnd.mpegurl m4u video/mp4 m4v +video/mxf mxf # possible image formats image/x-minolta-mrw mrw diff --git a/cvat/apps/engine/tests/test_rest_api.py b/cvat/apps/engine/tests/test_rest_api.py index 15c7c4ee52bd..8e3fa440f629 100644 --- a/cvat/apps/engine/tests/test_rest_api.py +++ b/cvat/apps/engine/tests/test_rest_api.py @@ -1697,12 +1697,13 @@ def generate_image_files(*args): return image_sizes, images -def generate_video_file(filename, width=1920, height=1080, duration=1, fps=25): +def generate_video_file(filename, width=1920, height=1080, duration=1, fps=25, codec_name='mpeg4'): f = BytesIO() total_frames = duration * fps - container = av.open(f, mode='w', format='mp4') + file_ext = os.path.splitext(filename)[1][1:] + container = av.open(f, mode='w', format=file_ext) - stream = container.add_stream('mpeg4', rate=fps) + stream = container.add_stream(codec_name=codec_name, rate=fps) stream.width = width stream.height = height stream.pix_fmt = 'yuv420p' @@ -2339,6 +2340,23 @@ def _test_api_v1_tasks_id_data(self, user): self._test_api_v1_tasks_id_data_spec(user, task_spec, task_data, self.ChunkType.IMAGESET, self.ChunkType.VIDEO, image_sizes, StorageMethodChoice.CACHE) + task_spec = { + "name": "test mxf format", + "use_zip_chunks": False, + "labels": [ + {"name": "car"}, + {"name": "person"}, + ], + } + + image_sizes, video = generate_video_file(filename="test_video_1.mxf", width=1280, height=720, codec_name='mpeg2video') + task_data = { + "client_files[0]": video, + "image_quality": 51, + } + + self._test_api_v1_tasks_id_data_spec(user, task_spec, task_data, self.ChunkType.VIDEO, self.ChunkType.VIDEO, image_sizes) + def test_api_v1_tasks_id_data_admin(self): self._test_api_v1_tasks_id_data(self.admin)