{"id":13701121,"url":"https://github.com/ryanfox/retread","last_synced_at":"2025-05-04T20:32:12.355Z","repository":{"id":8773725,"uuid":"59712135","full_name":"ryanfox/retread","owner":"ryanfox","description":"Detect reused frames in video","archived":true,"fork":false,"pushed_at":"2022-05-03T03:53:59.000Z","size":7,"stargazers_count":29,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-03T20:12:13.043Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanfox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-26T02:09:01.000Z","updated_at":"2024-05-28T15:59:43.000Z","dependencies_parsed_at":"2022-07-21T11:59:09.671Z","dependency_job_id":null,"html_url":"https://github.com/ryanfox/retread","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanfox%2Fretread","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanfox%2Fretread/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanfox%2Fretread/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanfox%2Fretread/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanfox","download_url":"https://codeload.github.com/ryanfox/retread/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224409957,"owners_count":17306388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T20:01:18.459Z","updated_at":"2024-11-13T07:30:43.616Z","avatar_url":"https://github.com/ryanfox.png","language":"HTML","funding_links":[],"categories":["HTML"],"sub_categories":[],"readme":"# retread\nDetect reused frames in video with Python.\n\nRetread works by computing a hash for each frame in a video (dhash, [described here](http://www.hackerfactor.com/blog/?/archives/529-Kind-of-Like-That.html) if you're interested).\nIt then counts how many times in the video that frame is reused.  Once the duplicates are calculated, the data is output in JSON format, suitable for use in e.g. [D3.js](https://d3js.org/).\n\nA video with low reuse across the board doesn't repeat many frames - not many duplicated shots, and not very long static images either.  For example, _Mad Max Fury Road_, a fast-moving film with short shots and quick cuts:\n\n![mad max fury road](https://i.imgur.com/ZUIVTWh.png)\n\nA video with high spikes reuses a lot of short shots or single images.  For example, _Memento_, a film notable for its nonlinear story, cutting forward and backward across the same scenes:\n\n![memento](https://i.imgur.com/YZ6vORD.png)\n\n## Installation\nClone the repository:\n\n    $ git clone git@github.com:ryanfox/retread.git\n\nInstall dependencies:\n\n    $ cd retread\n    $ pip install -r requirements.txt\n\n## Usage\n\n### Quickstart\n\n    $ python retread.py my_video.mp4 \u003e scores.json\n\nOpen `bar.html` in a browser to see the data plotted.\n\n### Advanced usage\nProcess a video file:\n\n    $ python retread.py my_video.mp4 \u003e scores.json\n\n`scores.json` will contain a list of integers, where each element is the number of duplicates that frame had in the original.\n\nProcessing a video can take a while - several minutes for a feature-length file.  There are a lot of frames to analyze!  If you want to reprocess the same video without waiting, you can use the flag `-s` (for \"save\") to save the hashes for later:\n\n    $ python retread.py -s my_video.mp4 \u003e scores.json\n\nThe hashes will be saved in `my_video.mp4.json`.  retread will overwrite the file if it already exists.\n\nTo reuse saved hashes, use the flag `-u` (for \"use\"):\n\n    $ python retread.py -u my_video.mp4.json \u003e scores.json\n\nThis will read the saved hashes (much faster than re-processing the whole video), do the duplicate analysis, and write the duplicate counts to standard out as usual.\n\nTo see what the most-duplicated frames are, you can save a jpeg image of the N most common frames.  Use the flag `-c` (for \"common\"):\n\n    $ python retread.py -c 5 my_video.mp4 \u003e scores.json\n    $ ls\n    0.jpg\n    1.jpg\n    2.jpg\n    3.jpg\n    4.jpg\n    my_video.mp4\n    [etc...]\n\nThis can be combined with `-u`, but you still need to specify the video file):\n\n    $ python retread.py -u my_video.mp4.json -c 5 my_video.mp4 \u003e scores.json\n    $ ls\n    0.jpg\n    1.jpg\n    2.jpg\n    3.jpg\n    4.jpg\n    my_video.mp4\n    my_video.mp4.json\n    [etc...]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanfox%2Fretread","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanfox%2Fretread","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanfox%2Fretread/lists"}