|
1 | 1 | import logging |
2 | | -from datetime import datetime |
3 | 2 | from followthemoney import model |
4 | 3 | from pymediainfo import MediaInfo |
5 | | -from normality import stringify |
6 | 4 |
|
7 | 5 | from ingestors.ingestor import Ingestor |
8 | 6 | from ingestors.support.timestamp import TimestampSupport |
9 | 7 | from ingestors.exc import ProcessingException |
10 | | -from ingestors.support.transcription import TranscriptionSupport |
11 | 8 |
|
12 | 9 | log = logging.getLogger(__name__) |
13 | 10 |
|
14 | 11 |
|
15 | | -class VideoIngestor(Ingestor, TimestampSupport, TranscriptionSupport): |
| 12 | +class VideoIngestor(Ingestor, TimestampSupport): |
16 | 13 | MIME_TYPES = [ |
17 | 14 | "application/x-shockwave-flash", |
18 | 15 | "video/quicktime", |
@@ -47,23 +44,6 @@ def ingest(self, file_path, entity): |
47 | 44 | entity.add("duration", track.duration) |
48 | 45 | except Exception as ex: |
49 | 46 | raise ProcessingException("Could not read video: %r", ex) from ex |
50 | | - try: |
51 | | - start = datetime.now() |
52 | | - log.info(f"Attempting to transcribe {file_path}") |
53 | | - audio_only_file = self.extract_audio(file_path) |
54 | | - self.transcribe(audio_only_file, entity) |
55 | | - elapsed_time = datetime.now() - start |
56 | | - # caution! this can't store an elapsed time larger than 24h |
57 | | - # datetime.seconds capped at [0,86400) |
58 | | - elapsed_time = divmod(elapsed_time.total_seconds(), 60)[0] |
59 | | - log.info( |
60 | | - f"Transcription duration: {elapsed_time} minutes (audio duration: {entity.get('duration')})" |
61 | | - ) |
62 | | - except Exception as ex: |
63 | | - # If the transcription fails, the file processing should still count as a success. |
64 | | - # The existance of a transcription is not mandatory, for now. |
65 | | - entity.set("processingError", stringify(ex)) |
66 | | - log.error(ex) |
67 | 47 |
|
68 | 48 | @classmethod |
69 | 49 | def match(cls, file_path, entity): |
|
0 commit comments