|
17 | 17 | config, |
18 | 18 | constants, |
19 | 19 | exceptions, |
20 | | - geo, |
21 | 20 | history, |
22 | 21 | ipc, |
23 | 22 | types, |
|
27 | 26 | VERSION, |
28 | 27 | ) |
29 | 28 | from .geotag import ( |
30 | | - blackvue_parser, |
31 | 29 | camm_builder, |
32 | | - camm_parser, |
33 | 30 | simple_mp4_builder, |
34 | | - utils as video_utils, |
35 | 31 | ) |
36 | 32 | from .types import FileType |
37 | 33 |
|
@@ -682,22 +678,6 @@ def upload( |
682 | 678 | raise UploadError(ex) from ex |
683 | 679 | LOG.debug("Uploaded to cluster: %s", cluster_id) |
684 | 680 |
|
685 | | - if DirectUploadFileType.RAW_BLACKVUE in filetypes: |
686 | | - video_paths = utils.find_videos( |
687 | | - import_paths, |
688 | | - skip_subfolders=skip_subfolders, |
689 | | - check_file_suffix=check_file_suffix, |
690 | | - ) |
691 | | - _upload_raw_blackvues_DEPRECATED(mly_uploader, video_paths) |
692 | | - |
693 | | - if DirectUploadFileType.RAW_CAMM in filetypes: |
694 | | - video_paths = utils.find_videos( |
695 | | - import_paths, |
696 | | - skip_subfolders=skip_subfolders, |
697 | | - check_file_suffix=check_file_suffix, |
698 | | - ) |
699 | | - _upload_raw_camm_DEPRECATED(mly_uploader, video_paths) |
700 | | - |
701 | 681 | if DirectUploadFileType.ZIP in filetypes: |
702 | 682 | zip_paths = utils.find_zipfiles( |
703 | 683 | import_paths, |
@@ -743,111 +723,6 @@ def upload( |
743 | 723 | LOG.info("Nothing uploaded. Bye.") |
744 | 724 |
|
745 | 725 |
|
746 | | -def _check_blackvue_DEPRECATED(video_path: Path) -> None: |
747 | | - # Skip in tests only because we don't have valid sample blackvue for tests |
748 | | - if os.getenv("MAPILLARY__DISABLE_BLACKVUE_CHECK") == "YES": |
749 | | - return |
750 | | - |
751 | | - points = blackvue_parser.parse_gps_points(video_path) |
752 | | - if not points: |
753 | | - raise exceptions.MapillaryGPXEmptyError("No GPS found in the BlackVue video") |
754 | | - |
755 | | - stationary = video_utils.is_video_stationary( |
756 | | - geo.get_max_distance_from_start([(p.lat, p.lon) for p in points]) |
757 | | - ) |
758 | | - if stationary: |
759 | | - raise exceptions.MapillaryStationaryVideoError("Stationary BlackVue video") |
760 | | - |
761 | | - |
762 | | -def _upload_raw_blackvues_DEPRECATED( |
763 | | - mly_uploader: uploader.Uploader, |
764 | | - video_paths: T.Sequence[Path], |
765 | | -) -> None: |
766 | | - for idx, video_path in enumerate(video_paths): |
767 | | - event_payload: uploader.Progress = { |
768 | | - "total_sequence_count": len(video_paths), |
769 | | - "sequence_idx": idx, |
770 | | - "file_type": DirectUploadFileType.RAW_BLACKVUE.value, |
771 | | - "import_path": str(video_path), |
772 | | - } |
773 | | - |
774 | | - try: |
775 | | - _check_blackvue_DEPRECATED(video_path) |
776 | | - except Exception as ex: |
777 | | - LOG.warning( |
778 | | - "Skipping %s %s due to: %s", |
779 | | - DirectUploadFileType.RAW_BLACKVUE.value.upper(), |
780 | | - video_path.name, |
781 | | - ex, |
782 | | - ) |
783 | | - continue |
784 | | - |
785 | | - with video_path.open("rb") as fp: |
786 | | - upload_md5sum = utils.md5sum_fp(fp).hexdigest() |
787 | | - try: |
788 | | - cluster_id = mly_uploader.upload_stream( |
789 | | - fp, |
790 | | - upload_api_v4.ClusterFileType.BLACKVUE, |
791 | | - upload_md5sum, |
792 | | - event_payload=event_payload, |
793 | | - ) |
794 | | - except Exception as ex: |
795 | | - raise UploadError(ex) from ex |
796 | | - LOG.debug("Uploaded to cluster: %s", cluster_id) |
797 | | - |
798 | | - |
799 | | -def _check_camm_DEPRECATED(video_path: Path) -> None: |
800 | | - # Skip in tests only because we don't have valid sample CAMM for tests |
801 | | - if os.getenv("MAPILLARY__DISABLE_CAMM_CHECK") == "YES": |
802 | | - return |
803 | | - |
804 | | - points = camm_parser.parse_gpx(video_path) |
805 | | - if not points: |
806 | | - raise exceptions.MapillaryGPXEmptyError("No GPS found in the CAMM video") |
807 | | - |
808 | | - stationary = video_utils.is_video_stationary( |
809 | | - geo.get_max_distance_from_start([(p.lat, p.lon) for p in points]) |
810 | | - ) |
811 | | - if stationary: |
812 | | - raise exceptions.MapillaryStationaryVideoError("Stationary CAMM video") |
813 | | - |
814 | | - |
815 | | -def _upload_raw_camm_DEPRECATED( |
816 | | - mly_uploader: uploader.Uploader, |
817 | | - video_paths: T.Sequence[Path], |
818 | | -) -> None: |
819 | | - for idx, video_path in enumerate(video_paths): |
820 | | - event_payload: uploader.Progress = { |
821 | | - "total_sequence_count": len(video_paths), |
822 | | - "sequence_idx": idx, |
823 | | - "file_type": DirectUploadFileType.RAW_CAMM.value, |
824 | | - "import_path": str(video_path), |
825 | | - } |
826 | | - try: |
827 | | - _check_camm_DEPRECATED(video_path) |
828 | | - except Exception as ex: |
829 | | - LOG.warning( |
830 | | - "Skipping %s %s due to: %s", |
831 | | - DirectUploadFileType.RAW_CAMM.value.upper(), |
832 | | - video_path.name, |
833 | | - ex, |
834 | | - ) |
835 | | - continue |
836 | | - try: |
837 | | - with video_path.open("rb") as fp: |
838 | | - upload_md5sum = utils.md5sum_fp(fp).hexdigest() |
839 | | - cluster_id = mly_uploader.upload_stream( |
840 | | - fp, |
841 | | - upload_api_v4.ClusterFileType.CAMM, |
842 | | - upload_md5sum, |
843 | | - event_payload=event_payload, |
844 | | - ) |
845 | | - except Exception as ex: |
846 | | - raise UploadError(ex) from ex |
847 | | - |
848 | | - LOG.debug("Uploaded to cluster: %s", cluster_id) |
849 | | - |
850 | | - |
851 | 726 | def _upload_zipfiles( |
852 | 727 | mly_uploader: uploader.Uploader, |
853 | 728 | zip_paths: T.Sequence[Path], |
|
0 commit comments