{"id":13491599,"url":"https://github.com/soruly/trace.moe-media","last_synced_at":"2025-03-28T08:33:20.868Z","repository":{"id":34049880,"uuid":"155083271","full_name":"soruly/trace.moe-media","owner":"soruly","description":"Media server for serving video preview for trace.moe","archived":true,"fork":false,"pushed_at":"2024-03-09T12:43:45.000Z","size":559,"stargazers_count":43,"open_issues_count":0,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-31T05:34:53.579Z","etag":null,"topics":["computer-graphics","graphics","image-processing"],"latest_commit_sha":null,"homepage":"https://trace.moe","language":"JavaScript","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/soruly.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["soruly"],"patreon":"soruly","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://www.paypal.me/soruly/"}},"created_at":"2018-10-28T15:02:36.000Z","updated_at":"2024-07-12T05:23:57.000Z","dependencies_parsed_at":"2023-02-12T07:16:36.815Z","dependency_job_id":"f6ad484c-fa2f-47f6-af1d-d9b38d639312","html_url":"https://github.com/soruly/trace.moe-media","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/soruly%2Ftrace.moe-media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soruly%2Ftrace.moe-media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soruly%2Ftrace.moe-media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/soruly%2Ftrace.moe-media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/soruly","download_url":"https://codeload.github.com/soruly/trace.moe-media/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245996837,"owners_count":20707336,"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":["computer-graphics","graphics","image-processing"],"created_at":"2024-07-31T19:00:58.512Z","updated_at":"2025-03-28T08:33:20.375Z","avatar_url":"https://github.com/soruly.png","language":"JavaScript","funding_links":["https://github.com/sponsors/soruly","https://patreon.com/soruly","https://www.paypal.me/soruly/"],"categories":["JavaScript"],"sub_categories":[],"readme":"# trace.moe-media\n\n[![License](https://img.shields.io/github/license/soruly/trace.moe-media.svg?style=flat-square)](https://github.com/soruly/trace.moe-media/blob/master/LICENSE)\n[![Discord](https://img.shields.io/discord/437578425767559188.svg?style=flat-square)](https://discord.gg/K9jn6Kj)\n\n### Media server for serving video preview for trace.moe\n\nThis server uses a \"video scene cutter\" which automatically detect timestamp boundaries of a shot, and then trim the shot out without leaking / exposing other frames that belongs to previous / next scenes.\n\nThis media server is now integrated into [trace.moe-api](https://github.com/soruly/trace.moe-api). This is no longer needed for serving media preview.\n\n#### Background of this project\n\nWhen search result from trace.moe returns an anime, episode and a timecode, it can generate a video preview for the scene at that time code.\n\nQuery image:\n\n![](https://images.plurk.com/3F4Mg666qw78rImF7DR2SG.jpg)\n\nSearch result: `Shelter, episode 1, timecode: 00:00:51.83`\n\nVideo Preview at time `00:00:51.83`\n\n|           Fixed offset without trace.moe-media           |             Auto detect with trace.moe-media             |\n| :------------------------------------------------------: | :------------------------------------------------------: |\n| ![](https://images.plurk.com/7lURadxyYVrvPl52M7mm3G.gif) | ![](https://images.plurk.com/2mcJxwtMJFSVhLQ8XDUYI3.gif) |\n|            00:50.93 (-0.9) to 00:53.93 (+2.1)            |              00:49.22 to 00:51.30 (dynamic)              |\n\nBy using first / last frames from the fixed offset preview, user may be able to use that to search again and reveal previous/next scene of the original video. By repeating this process, users may eventually read the whole video until the rate limit/search quota used up.\n\nWith the video preview generated by auto detect method, searching any frame form the preview would only results the same video preview. This prevents leaking the previous/next scene.\n\n### How does it work\n\nTo be completed\n![](https://images.plurk.com/2NDcHsv4PFLWX5q64zHts7.jpg)\n\n### Getting Started\n\n```bash\ndocker run -it --rm -v /path/to/video/=/mnt/ -p 3000:3000 ghcr.io/soruly/trace.moe-media:latest\n```\n\n#### List files\n\n```\nhttp://127.0.0.1:3000/list/\n```\n\n#### Video URL\n\n```\nhttp://127.0.0.1:3000/file/foo/bar.mp4\n```\n\nFor this URL endpoint, use HTTP Method PUT, DELETE to upload and delete files.\n\nTo secure this endpoint, define the `TRACE_API_SECRET` environment variable, and put `x-trace-secret` in HTTP header when sending requests.\n\n#### Video Preview URL\n\n```\nhttp://127.0.0.1:3000/video/foo/bar.mp4?t=87\n```\n\nYou can use the `\u0026size=` param to specify preview size (l: 640, m: 320, s: 160)\n\n```\nhttp://127.0.0.1:3000/video/foo/bar.mp4?t=87\u0026size=l\n```\n\nYou can use the `\u0026mute` param to generate a muted video (like GIF)\n\n```\nhttp://127.0.0.1:3000/video/foo/bar.mp4?t=87\u0026size=l\u0026mute\n```\n\n#### Image Preview URL\n\n```\nhttp://127.0.0.1:3000/image/foo/bar.mp4?t=87\n```\n\nYou can use the `\u0026size=` param to specify preview size (l: 640, m: 320, s: 160)\n\n```\nhttp://127.0.0.1:3000/image/foo/bar.mp4?t=87\u0026size=l\n```\n\n### Environment variables\n\n```\nVIDEO_PATH=         # e.g. /mnt/data/anilist/\nSERVER_PORT=        # e.g. 3001\nSERVER_ADDR=        # e.g. 127.0.0.1 or 0.0.0.0\nTRACE_MEDIA_SALT=   # define any random string, or leave blank to disable secure token\nTRACE_API_SECRET=   # same as TRACE_API_SECRET in trace.moe api's .env, or leave blank to disable auth\n```\n\n### Local Development\n\nGit clone this repository, npm install, copy `.env.example` to `.env`, Edit `.env` as you need, then start server\n\n```\nnode server.js\n```\n\nYou also can use pm2 to run this in background in cluster mode.\n\nUse below commands to start / restart / stop server.\n\n```\nnpm run start\nnpm run stop\nnpm run reload\nnpm run restart\nnpm run delete\n```\n\nTo change the number of nodejs instances, edit ecosystem.config.json\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoruly%2Ftrace.moe-media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoruly%2Ftrace.moe-media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoruly%2Ftrace.moe-media/lists"}