Skip to content

Commit

Permalink
skip videohash if unable to extract frames; updated library dependenc…
Browse files Browse the repository at this point in the history
…y to ignore crops of 0
  • Loading branch information
dale-wahl committed Dec 12, 2023
1 parent 7a1c4b9 commit 5f5e10f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
7 changes: 5 additions & 2 deletions processors/visualisation/video_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import zipfile

from videohash import VideoHash
from videohash.exceptions import FFmpegNotFound
from videohash.exceptions import FFmpegNotFound, FFmpegFailedToExtractFrames

from backend.lib.processor import BasicProcessor
from backend.lib.preset import ProcessorPreset
Expand Down Expand Up @@ -158,7 +158,10 @@ def process(self):
self.dataset.finish(0)
return
except FileNotFoundError as e:
self.dataset.update_status(f"Unable to create hash for {str(path)}")
self.dataset.update_status(f"Unable to find file {str(path)}")
continue
except FFmpegFailedToExtractFrames as e:
self.dataset.update_status(f"Unable to extract frame for {str(path)}: {e}")
continue

video_hashes[path.name] = {'videohash': videohash}
Expand Down
2 changes: 1 addition & 1 deletion processors/visualisation/video_timelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def process(self):

if looping:
# Only prep for new timeline if still looping
self.dataset.update_status(f"Rendering video timeline for collection {video}")
self.dataset.update_status(f"Rendering video timeline for collection {video} ({len(timeline_widths)}/{self.source_dataset.num_rows})")
self.dataset.update_progress(len(timeline_widths) / self.source_dataset.num_rows)
# reset and ready for the next timeline
offset_y += base_height
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"unidecode~=1.3",
"Werkzeug~=2.2",
"wordcloud~=1.8",
"videohash==3.0.1",
"videohash @ https://github.com/dale-wahl/videohash/archive/refs/heads/main.zip",
"vk_api",
"yt-dlp",
Expand Down

0 comments on commit 5f5e10f

Please sign in to comment.