snake98 19 Posted November 2 Posted November 2 (edited) Hi all, The audio twin of SubRemover: AudioRemover removes the audio tracks in languages you don't want from your video files and leaves everything else alone. Video and subtitles are copied as-is, with no re-encoding. It can also fix wrong language tags, pick the best-quality track as the default, and clean site and release-group ads out of track names. Latest version: 1.0.0 – what changed is under Revisions at the bottom. What it does Choose the languages to keep: every other audio track is removed. Never leaves a video without sound: when no main track is in a language you keep (a foreign film with only its own language), every track stays. Test mode is on by default: nothing is changed; it only logs what it would do. Backups: the original is kept next to the video or copied to a folder you choose. Old backups can be deleted after a number of days. Undo: Restore originals from backups lists every video that has a backup. Tick the ones to put back and confirm. Moved videos are found again: move a video, a folder or a whole library on your share and the next run finds it by its file name. Its backup and its "already done" record follow it, so it isn't redone and can still be restored. Safety check: every new file is checked against the original before it replaces it. If anything doesn't match, the original stays. Options Keep audio with no language set, and optionally always keep the first audio track Remove commentary tracks and audio description tracks, even in languages you keep (only while a main track stays) Set the default audio track: the default moves off removed, commentary and audio description tracks. Or choose a Default audio language. Default to the best-quality track: between tracks in the same language, the one with the most channels wins (5.1 over a stereo copy), then lossless, then the higher bitrate Clean up track names: takes ads like English - SomeSite.com out of track names, so Emby's audio and subtitle menus show the language and format instead. The list of what's removed is editable (websites like *.com, words, or regular expressions), with Check and Reset buttons. Suggested text: every run collects text that keeps turning up in track names across different films and shows (release group tags and the like) into an editable box. Pick what to add; text you add is cleaned out of the videos it was found in. Language labels like English (United States) or pt-BR are never suggested. New in 1.0.0: subtitles that match the original file (with SubRemover) Subtitle sites like OpenSubtitles find exact-match (hash-matched) subtitles by the hash of the original file, and rewriting a video changes that hash. So: With SubRemover's Download hash-matched subtitles before changing a video on, AudioRemover does that look-up itself for any video neither plugin has changed yet, before it changes it. It follows SubRemover's languages and daily download limit, and needs a subtitle downloader (such as OpenSubtitles) set up in Emby. If the search fails or today's download limit is used up, the video is left unchanged for a later run, so the perfect match can still be found. Wait until SubRemover has checked a video (Run tab, off by default): AudioRemover leaves a video alone until SubRemover has been through it, so SubRemover does the subtitle step first. New videos that have to wait are tried again every 10 minutes for up to a day. Test mode only logs which videos would wait. Without SubRemover installed, none of this applies and nothing changes. Listening with Whisper (optional) When a video has two or more audio tracks and none is tagged with a language you keep, Whisper (a free speech model that runs offline on your server) listens to short clips of each track and names the language spoken. Act on what it hears: a "Finnish" track that's really English is kept and its tag corrected. Extra safe: before a tag is changed, the next bigger Whisper model listens to 10 more clips, and at least 7 must agree, each 90% sure. Check and retag a lone track: a video's only track, tagged with a language you don't keep, gets its tag corrected when it's really your language. Tag tracks that have no language: two or more untagged tracks (often a stereo and a 5.1 copy) get the language Whisper hears, so Emby shows "English" instead of "Unknown". whisper.cpp and the model you choose (Base, 141 MB, recommended) are downloaded the first time they're needed, from fixed addresses, and checked against their checksums. Easy to use Its own settings page with tabs: Run, Audio, Listen (Whisper), Track names, Backups and Logs. One Save covers every tab. Each tab explains its own settings in a Help section at the bottom. Run now and Stop with a live status line, and a log viewer on the Logs tab: open any run log in a new window or download it. Process new videos as they're added: when Emby adds videos, AudioRemover waits until none have arrived for a few minutes, then checks just those in one run. An entry in the server sidebar under Advanced (can be turned off) Limits for testing: Max videos per run, and Only process paths containing to try it on a single title (several titles separated with ;) Every run log starts with your settings and ends with totals of what was (or would be) done. Works alongside SubRemover: the two never rewrite the same file at the same time, and the order they run in doesn't matter. Install Download Emby.AudioRemover.dll from the GitHub Releases page (take the newest one): https://github.com/Snake98bm/Emby.AudioRemover/releases Stop Emby Server and copy the DLL into Emby's plugins folder: Windows: %AppData%\Emby-Server\programdata\plugins Linux: /var/lib/emby/plugins Docker (emby/embyserver or linuxserver/emby): /config/plugins inside the container. On the host, that's the plugins folder inside the folder you mapped to /config, e.g. /docker/emby/config/plugins. Stop the container (docker stop emby), copy the DLL there, and make sure it has the same owner as the other files in that folder (your PUID/PGID). Or copy it straight into the container: docker cp Emby.AudioRemover.dll emby:/config/plugins/ (Replace emby with your container's name.) Start Emby (Docker: docker start emby) and press Ctrl+F5 in your browser. Go to Settings → Plugins → AudioRemover. On the Run tab pick your libraries and leave Test mode on. On the Audio tab pick the languages to keep (or click Quick setup). Click Save. Click Run now, then read the run log on the Logs tab. When the log looks right, turn Test mode off, set Max videos to change per run to a few, and run it again. Check those files in Emby before letting it do the rest. Updating: same as installing. Stop Emby, replace the DLL, start Emby and press Ctrl+F5. Your settings carry over. Tested on Emby Server 4.10.2 on Windows, with full-library test runs (8,000+ videos) The build and tests also pass on Linux, but I haven't run it on a real Linux or Docker server yet. The ready-made Whisper download is for Windows; on Linux, whisper.cpp is installed by hand. Feedback welcome! Revisions 1.0.0 – Subtitles that match the original file: with SubRemover's Download hash-matched subtitles before changing a video on, AudioRemover looks them up itself before changing a video neither plugin has changed yet, and leaves the video for later if the search fails or the daily limit is used up. New option Wait until SubRemover has checked a video (Run tab, off by default); new videos that wait are tried again every 10 minutes for a day. If SubRemover's settings can't be read at that moment, the video waits instead of being changed. 0.5.2 – New settings page with tabs (Run, Audio, Listen (Whisper), Track names, Backups, Logs), each with its own help, and one Save for all of them. Download Whisper and Find text to remove show their progress as they go. Restore is now one list with tick boxes. Videos moved on your share are found again by file name, and their backups and records follow them. 0.5.1 – New: Suggested text, built up by every run, with Where they were found, and Clean names where added suggestions were found. Language labels, native language names, format words and commentary names are never suggested. A line in the list also matches words joined by _. Whisper's status shows the date of its latest check. The Help section no longer shows repeated entries after an update. 0.5.0 – First public release: language filtering, default audio and best-quality default, Whisper listening (act on it, extra safe, lone-track retag, tagging untagged tracks), track name clean-up, restore, and processing new videos as they're added. Source code, issues and the MIT license are on GitHub: https://github.com/Snake98bm/Emby.AudioRemover Its twin for subtitles, SubRemover (removes unwanted embedded subtitle tracks): Forum thread: SubRemover – remove unwanted embedded subtitle tracks Please keep Test mode on for your first run and keep backups on. If something looks wrong in the log, post it here or open an issue on GitHub. Emby.AudioRemover.dll Edited November 12 by snake98 update to 1.0
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now