{"id":13835438,"url":"https://github.com/divout/mpv_reduce_stream_cache","last_synced_at":"2025-07-10T07:32:06.487Z","repository":{"id":141938699,"uuid":"443565996","full_name":"divout/mpv_reduce_stream_cache","owner":"divout","description":"Reduces MPV cache for streams by increasing playback speed.","archived":false,"fork":false,"pushed_at":"2023-11-02T02:36:57.000Z","size":4,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-05T14:16:16.340Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/divout.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-01-01T15:26:33.000Z","updated_at":"2024-03-29T20:48:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"83165799-b09d-4969-8521-b0a9532b3d48","html_url":"https://github.com/divout/mpv_reduce_stream_cache","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/divout%2Fmpv_reduce_stream_cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divout%2Fmpv_reduce_stream_cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divout%2Fmpv_reduce_stream_cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divout%2Fmpv_reduce_stream_cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divout","download_url":"https://codeload.github.com/divout/mpv_reduce_stream_cache/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225627378,"owners_count":17498972,"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-04T14:01:02.013Z","updated_at":"2024-11-20T20:31:26.001Z","avatar_url":"https://github.com/divout.png","language":"JavaScript","funding_links":[],"categories":["Streaming"],"sub_categories":[],"readme":"# Reduce stream cache\nReduces MPV cache for streams by increasing playback speed. It meant to work with Twitch through [Streamlink](https://streamlink.github.io/install.html). I find this setup has a few hundred milliseconds lower latency than the Twitch web player.\n\n## Installation\n\nCopy related folders to your MPV config folder `~/.config/mpv`.\n\n## Script configuration\n\nIn `./script-opts/reduce_stream_cache.conf`, you can adjust when to start and stop speeding up the playback. The default configuration is quite aggressive, and it works fine on a wired stable Internet connection. But if you or your streamer have an unstable Internet connection, consider increasing `enable_faster_speed_over_cache_seconds` to prevent often speed changes. Or turn off this script with `a` shortcut.\n\n## Make an MPV profile\n\nMPV has its own `low-latency` profile. But the profile below has lower latency in my setup.\n\n```bash\n# ~/.config/mpv/mpv.conf\n[stream]\ndemuxer-lavf-o-add=\"fflags=+nobuffer+fastseek+flush_packets\"\ncache=no\ndeband=no\ndither-depth=no\nscale=bilinear\ncscale=bilinear\ndscale=bilinear\nscale-antiring=0\ncscale-antiring=0\ndither-depth=no\ncorrect-downscaling=no\nsigmoid-upscaling=no\n```\n\n## Start a stream with Streamlink.\n\n```bash\nstreamlink twitch.tv/twitch \\\n  best \\\n  -p \"mpv\" \\\n  --player-args=\"--profile='stream' --script-opts='enable-stream-cache-reduction=true'\" \\\n  --title=\"stream-twitch\" \\\n  --twitch-low-latency \\\n  --twitch-disable-ads \\\n  --ringbuffer-size=256M\n```\n\nYou can put it in the [gnome extension](https://extensions.gnome.org/extension/1078/twitchlive-panel/) or modify the [play-with-mpv](https://github.com/Thann/play-with-mpv) Chrome extension to your liking.\n\n## Stream replay\n\nIf you use the MPV profile that disables cache, you won't be able to seek the video stream. As a workaround, you can record the stream to `/tmp/` and open the recorded video with a shortcut.\n\n```bash\nstreamlink twitch.tv/twitch \\\n  best \\\n  -p \"mpv\" \\\n  --player-args=\"--profile='stream' --script-opts='enable-stream-cache-reduction=true'\" \\\n  --title=\"stream-twitch\" \\\n  --twitch-low-latency \\\n  --twitch-disable-ads \\\n  --ringbuffer-size=256M \\\n  --record=\"/tmp/stream-twitch.mp4\" \\\n  --force\n```\n\nThen pressing `'` will open the recorded video. See `./script-opts/stream_replay.conf` for configuration.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivout%2Fmpv_reduce_stream_cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivout%2Fmpv_reduce_stream_cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivout%2Fmpv_reduce_stream_cache/lists"}