{"id":13835141,"url":"https://github.com/ferreum/mpv-skipsilence","last_synced_at":"2025-07-10T07:31:22.506Z","repository":{"id":181699912,"uuid":"666767742","full_name":"ferreum/mpv-skipsilence","owner":"ferreum","description":"Increase playback speed during silence - a revolution in attention-deficit induction technology.","archived":false,"fork":false,"pushed_at":"2024-05-07T22:02:09.000Z","size":234,"stargazers_count":40,"open_issues_count":1,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-11-20T20:39:01.811Z","etag":null,"topics":["mpv","mpv-scripts"],"latest_commit_sha":null,"homepage":"https://codeberg.org/ferreum/mpv-skipsilence/","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ferreum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2023-07-15T14:07:39.000Z","updated_at":"2024-11-02T00:21:37.000Z","dependencies_parsed_at":"2023-07-16T22:46:33.533Z","dependency_job_id":"31f361c3-4b12-4da0-9f75-2b8842e83010","html_url":"https://github.com/ferreum/mpv-skipsilence","commit_stats":null,"previous_names":["ferreum/mpv-skipsilence"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ferreum/mpv-skipsilence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreum%2Fmpv-skipsilence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreum%2Fmpv-skipsilence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreum%2Fmpv-skipsilence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreum%2Fmpv-skipsilence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ferreum","download_url":"https://codeload.github.com/ferreum/mpv-skipsilence/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ferreum%2Fmpv-skipsilence/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545167,"owners_count":23625404,"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":["mpv","mpv-scripts"],"created_at":"2024-08-04T14:00:57.203Z","updated_at":"2025-07-10T07:31:17.498Z","avatar_url":"https://github.com/ferreum.png","language":"Lua","funding_links":[],"categories":["Playback"],"sub_categories":[],"readme":"# mpv-skipsilence\n\nIncrease playback speed during silence - a revolution in attention-deficit\ninduction technology.\n\nMain repository: https://codeberg.org/ferreum/mpv-skipsilence/\n\nBased on the script https://gist.github.com/bitingsock/e8a56446ad9c1ed92d872aeb38edf124\n\nThis is inspired by the NewPipe app's built-in \"Fast-forward during silence\"\nfeature.\n\n\u003e Note: In mpv version 0.36 and below, the `scaletempo2` filter (default since\n\u003e mpv version 0.34) caused audio-video de-synchronization when changing speed\n\u003e a lot. This has been fixed in mpv 0.37. See [mpv issue\n\u003e #12028](https://github.com/mpv-player/mpv/issues/12028). Small, frequent\n\u003e speed changes instead of large steps may help to reduce this problem. The\n\u003e scaletempo and rubberband filters didn't have this problem, but have\n\u003e different audio quality characteristics.\n\n## Features:\n\n- Parameterized speedup ramp, allowing profiles for different kinds of\n  media (`ramp_*`, `speed_*`, `startdelay` options).\n- Noise reduction of the detected signal. This allows to speed up\n  pauses in speech despite background noise. The output audio is\n  unaffected by default (`arnndn_*` options).\n- Saved time estimation.\n- Integration with osd-msg, auto profiles, etc. (with user-data, mpv 0.36 and\n  above only).\n- Experimental: Lookahead for dynamic slowdown and faster reaction time\n  (`lookahead`, `slowdown_ramp_*`, `margin_*` options).\n- Workaround for scaletempo2 audio-video desynchronization in mpv 0.36 and\n  below (`resync_threshold_droppedframes` option).\n- Workaround for clicks during speed changes with scaletempo2 in mpv 0.36 and\n  below (`alt_normal_speed` option).\n\n### Silence detection visualized\n\nThe following graph shows an example silence detection and resulting playback\nspeed, annotated with options that impact speed changes.\n\n![silence detection visualization](./images/detection.svg)\n\nIf the experimental `lookahead` option is set to a positive value, the effect\nof some options changes:\n\n\u003csup\u003e1)\u003c/sup\u003e Without lookahead, `Silence Start` is delayed by\n`threshold_duration`. If lookahead is active, it reduces this delay by up to\nthat configured lookahead duration.\n\n\u003csup\u003e2)\u003c/sup\u003e `minduration` is only supported with lookahead.\n\n\u003csup\u003e3)\u003c/sup\u003e `startdelay` is ignored if lookahead is enabled and\n`margin_start` is used instead.\n\n\u003csup\u003e4)\u003c/sup\u003e The box marked `if lookahead` only applies if lookahead is\nactive. Otherwise, the speed is reverted in a single step exactly at the time\nof `Silence End` detection.\n\n## Default bindings\n\n- F2 - toggle\n- F3 - threshold-down\n- F4 - threshold-up\n\n## Documentation\n\nFor detailed usage check the comments at the top of the [script](skipsilence.lua).\n\n## Recommendations\n\n### Temporarily disable display sync\n\nWhen using `video-sync=display-*`, speed changes tend to cause increased video\nlag. Because display sync is less useful while speed keeps changing, it's\nrecommended to use `video-sync=audio` (the default) while this script is\nactive. This results in smoother video playback during speed transitions.\n\nThe following profile can be used to automatically switch to `video-sync=audio`\nwhen skipsilence is enabled and restore it when disabled (requires mpv 0.36 or\nabove for user-data):\n\n    [auto-skipsilence-videosync]\n    profile-cond=get(\"user-data/skipsilence/enabled\")\n    profile-restore=copy-equal\n    video-sync=audio\n\n### Fix clicking sounds/gaps when switching to and from 1x speed\n\nIn the default configuration, mpv automatically inserts scaletempo2 filter when\nchanging speed and removes it when returning to 1x playback speed. This often\ncauses clicks in audio playback. To prevent this, add `scaletempo2` to the `af`\nfilter list explicitly:\n\n    af-add=scaletempo2\n\nIn mpv 0.36 and below, the scaletempo2 filter itself additionally caused\nsimilar artifacts when switching to and from 1x speed. This has been fixed in\nmpv 0.37. The `alt_normal_speed` option of this script is a workaround for\nolder versions.\n\n### Fix silence at high playback speed\n\nBy default, scaletempo2 produces silence above 8x playback speed (4x in mpv\n0.36 and below). To lift this limit, set the `max-speed` parameter in the\nfilter definition (see above) like this:\n\n    af-add=scaletempo2=max-speed=16.0\n\n### Maximize skipping speed\n\nBecause of the asynchronous nature of scripts, there is latency between silence\ndetection and speed changes. The higher the playback speed, the more noticeably\nplayback will overshoot before normal speed is restored. What speeds are\nacceptable depends on the performance/latency of the system.\n\nTo maximize skipping speed, start with the extreme profile (see\n[Profiles](#profiles) below). Then adjust `ramp_constant`, `ramp_factor`,\n`max_speed` options as needed.\n\n- If overshooting happens all the time, even for very short pauses, reduce\n  `ramp_constant`.\n- If it happens after the speed ramped up more, focus on `ramp_factor`.\n- For the occasional long stretch of silence this may be less of a problem, but\n  can be improved by reducing `max_speed` at a cost of slower skipping.\n- Notice that extreme values of `ramp_exponent` tend to be less useful. It's\n  recommended to keep the `ramp_exponent` around 0.9 for aggressive profiles.\n\n#### Lookahead\n\nThe experimental lookahead option makes much higher maximum speed practical by\ngradually slowing down before the end of silence is reached. See the\n`lookahead`, `slowdown_ramp_*` and `margin_*` options. To maximize skipping\nspeed, use a slowdown ramp that is as steep as possible without overshooting on\nslowdown. `margin_end` can help, but is usually not required.\n\n### Profiles\n\nMpv's profiles can be used to switch between different presets. Create profiles\nin `mpv.conf` and apply them with the `apply-profile` command.\n\n    [skipsilence-default]\n    script-opts-append=skipsilence-ramp_constant=1.25\n    script-opts-append=skipsilence-ramp_factor=2.5\n    script-opts-append=skipsilence-ramp_exponent=1\n    script-opts-append=skipsilence-speed_max=4\n    script-opts-append=skipsilence-speed_updateinterval=0.05\n    script-opts-append=skipsilence-startdelay=0.05\n\nBind it to a key in `input.conf`:\n\n    F5 script-message-to skipsilence enable no-osd; apply-profile skipsilence-default; show-text \"skipsilence profile: default\"\n\n#### Examples\n\n    # very smooth speed increase, up to 3x\n    [skipsilence-smooth]\n    script-opts-append=skipsilence-ramp_constant=1\n    script-opts-append=skipsilence-ramp_factor=0.4\n    script-opts-append=skipsilence-ramp_exponent=1.45\n    script-opts-append=skipsilence-speed_max=3\n    script-opts-append=skipsilence-speed_updateinterval=0.05\n    script-opts-append=skipsilence-startdelay=0\n    script-opts-append=skipsilence-threshold_duration=0.25\n\n    # very aggressive skipping, can make it hard to listen\n    [skipsilence-extreme]\n    script-opts-append=skipsilence-ramp_constant=2.5\n    script-opts-append=skipsilence-ramp_factor=10\n    script-opts-append=skipsilence-ramp_exponent=0.9\n    script-opts-append=skipsilence-speed_max=6\n    script-opts-append=skipsilence-speed_updateinterval=0.05\n    script-opts-append=skipsilence-startdelay=0\n    script-opts-append=skipsilence-threshold_duration=0.05\n\n    # long wait (1s) before speeding up quickly\n    [skipsilence-patient]\n    script-opts-append=skipsilence-ramp_constant=1.25\n    script-opts-append=skipsilence-ramp_factor=3\n    script-opts-append=skipsilence-ramp_exponent=0.9\n    script-opts-append=skipsilence-speed_max=4\n    script-opts-append=skipsilence-speed_updateinterval=0.05\n    script-opts-append=skipsilence-startdelay=0\n    script-opts-append=skipsilence-threshold_duration=1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferreum%2Fmpv-skipsilence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fferreum%2Fmpv-skipsilence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fferreum%2Fmpv-skipsilence/lists"}