{"id":33141971,"url":"https://github.com/tp7/Sushi","last_synced_at":"2025-11-20T06:03:13.521Z","repository":{"id":17112086,"uuid":"19878084","full_name":"tp7/Sushi","owner":"tp7","description":"Automatic subtitle shifter based on audio","archived":false,"fork":false,"pushed_at":"2022-07-17T18:19:16.000Z","size":202,"stargazers_count":677,"open_issues_count":20,"forks_count":49,"subscribers_count":34,"default_branch":"master","last_synced_at":"2025-08-25T22:49:13.557Z","etag":null,"topics":["ass-subtitles","audio-analysis","python","srt-subtitles","subtitle"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tp7.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-17T04:08:45.000Z","updated_at":"2025-08-22T19:26:49.000Z","dependencies_parsed_at":"2022-07-26T01:49:37.172Z","dependency_job_id":null,"html_url":"https://github.com/tp7/Sushi","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tp7/Sushi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7%2FSushi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7%2FSushi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7%2FSushi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7%2FSushi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tp7","download_url":"https://codeload.github.com/tp7/Sushi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tp7%2FSushi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285382190,"owners_count":27162159,"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","status":"online","status_checked_at":"2025-11-20T02:00:05.334Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ass-subtitles","audio-analysis","python","srt-subtitles","subtitle"],"created_at":"2025-11-15T12:00:48.323Z","updated_at":"2025-11-20T06:03:13.509Z","avatar_url":"https://github.com/tp7.png","language":"Python","readme":"## Sushi [![Build Status](https://travis-ci.org/tp7/Sushi.svg?branch=master)](https://travis-ci.org/tp7/Sushi)\nAutomatic shifter for SRT and ASS subtitle based on audio streams.\n\n### Purpose\nImagine you've got a subtitle file synced to one video file, but you want to use these subtitles with some other video you've got via totally legal means. The common example is TV vs. BD releases, PAL vs. NTSC video and releases in different countries. In a lot of cases, subtitles won't match right away and you need to sync them.\n\nThe purpose of this script is to avoid all the hassle of manual syncing. It attempts to synchronize subtitles by finding similarities in audio streams. The script is very fast and can be used right when you want to watch something.\n\n### Downloads\nThe latest Windows binary release can always be found in the [releases][1] section. You need the 7z archive in the top entry.\n\n### How it works\nYou need to provide two audio files and a subtitle file that matches one of those files. For every line of the subtitles, the script will extract corresponding audio from the source audio stream and will try to find the closest similar pattern in the destination audio stream, obtaining a shift value which is later applied to the subtitles.\n\nDetailed explanation of Sushi workflow and description of command-line arguments can be found in the [wiki][2].\n\n### Usage\nThe minimal command line looks like this:\n```\npython sushi.py --src hdtv.wav --dst bluray.wav --script subs.ass\n```\nOutput file name is optional - `\"{destination_path}.sushi.{subtitles_format}\"` is used by default. See the [usage][3] page of the wiki for further examples.\n\nDo note that WAV is not the only format Sushi can work with. It can process audio/video files directly and decode various audio formats, provided that ffmpeg is available. For additional info refer to the [Demuxing][4] part of the wiki.\n\n### Requirements\nSushi should work on Windows, Linux and OS X. Please open an issue if it doesn't. To run it, you have to have the following installed:\n\n1. [Python 2.7.x][5]\n2. [NumPy][6] (1.8 or newer)\n3. [OpenCV 2.4.x or newer][7] (on Windows putting [this file][8] in the same folder as Sushi should be enough, assuming you use x86 Python)\n\nOptionally, you might want:\n\n1. [FFmpeg][9] for any kind of demuxing\n2. [MkvExtract][10] for faster timecodes extraction when demuxing\n3. [SCXvid-standalone][11] if you want Sushi to make keyframes\n4. [Colorama](https://github.com/tartley/colorama) to add colors to console output on Windows\n\nThe provided Windows binaries include all required components and Colorama so you don't have to install them if you use the binary distribution. You still have to download other applications yourself if you want to use Sushi's demuxing capabilities.\n\n#### Installation on Mac OS X\n\nNo binary packages are provided for OS X right now so you'll have to use the script form. Assuming you have python 2, pip and [homebrew](http://brew.sh/) installed, run the following:\n```bash\nbrew tap homebrew/science\nbrew install git opencv\npip install numpy\ngit clone https://github.com/tp7/sushi\n# create a symlink if you want to run sushi globally\nln -s `pwd`/sushi/sushi.py /usr/local/bin/sushi\n# install some optional dependencies\nbrew install ffmpeg mkvtoolnix\n```\nIf you don't have pip, you can install numpy with homebrew, but that will probably add a few more dependencies.\n```bash\nbrew tap homebrew/python\nbrew install numpy\n```\n\n#### Installation on Linux\nIf you have apt-get available, the installation process is trivial.\n```bash\nsudo apt-get update\nsudo apt-get install git python python-numpy python-opencv\ngit clone https://github.com/tp7/sushi\nln -s `pwd`/sushi/sushi.py /usr/local/bin/sushi\n```\n\n### Limitations\nThis script will never be able to property handle frame-by-frame typesetting. If underlying video stream changes (e.g. has different telecine pattern), you might get incorrect output.\n\nThis script cannot improve bad timing. If original lines are mistimed, they will be mistimed in the output file too.\n\nIn short, while this might be safe for immediate viewing, you probably shouldn't use it to blindly shift subtitles for permanent storing.\n\n\n  [1]: https://github.com/tp7/Sushi/releases\n  [2]: https://github.com/tp7/Sushi/wiki\n  [3]: https://github.com/tp7/Sushi/wiki/Examples\n  [4]: https://github.com/tp7/Sushi/wiki/Demuxing\n  [5]: https://www.python.org/downloads/\n  [6]: http://www.scipy.org/scipylib/download.html\n  [7]: http://opencv.org/\n  [8]: https://www.dropbox.com/s/nlylgdh4bgrjgxv/cv2.pyd?dl=0\n  [9]: http://www.ffmpeg.org/download.html\n  [10]: http://www.bunkus.org/videotools/mkvtoolnix/downloads.html\n  [11]: https://github.com/soyokaze/SCXvid-standalone/releases\n","funding_links":[],"categories":["Subtitles"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftp7%2FSushi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftp7%2FSushi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftp7%2FSushi/lists"}