{"id":18256841,"url":"https://github.com/hrichharms/ffmpeg_filters_mse","last_synced_at":"2026-05-17T02:41:51.162Z","repository":{"id":132969896,"uuid":"469972842","full_name":"hrichharms/ffmpeg_filters_mse","owner":"hrichharms","description":"Calculates and visualizes the temporal domain and frequency domain mean squared error of ffmpeg audio filters","archived":false,"fork":false,"pushed_at":"2022-03-18T21:08:57.000Z","size":60,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T17:43:21.872Z","etag":null,"topics":["audio-filters","audio-processing","ffmpeg","mean-square-error","psnr"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrichharms.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-15T02:09:03.000Z","updated_at":"2024-11-28T04:26:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"bec69dba-4391-427e-b8fe-83473f48c854","html_url":"https://github.com/hrichharms/ffmpeg_filters_mse","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/hrichharms%2Fffmpeg_filters_mse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrichharms%2Fffmpeg_filters_mse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrichharms%2Fffmpeg_filters_mse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrichharms%2Fffmpeg_filters_mse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrichharms","download_url":"https://codeload.github.com/hrichharms/ffmpeg_filters_mse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247938381,"owners_count":21021513,"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":["audio-filters","audio-processing","ffmpeg","mean-square-error","psnr"],"created_at":"2024-11-05T10:23:53.793Z","updated_at":"2025-10-14T04:35:05.483Z","avatar_url":"https://github.com/hrichharms.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ffmpeg_filters_mse\n\nCalculates and visualizes the temporal domain and frequency domain mean squared error of [ffmpeg audio filters](https://ffmpeg.org/ffmpeg-filters.html).\n\n## Setup\n\n1. Install [ffmpeg](https://ffmpeg.org/download.html)\n2. Install required Python packages ( `pip3 install -r requirements.txt` )\n3. Create `original_audio` directory\n4. Put audio in `original_audio` directory\n\n## Usage\n\n1. Run `convert.sh` if audio files are not in .wav format\n2. Run `apply_filters.py` to create filtered audio files\n3. Run `mse.py` to calculate the mean square error for each filter\n4. Run `visualize.py` to visualize the results as bar graphs\n\n## Repository Files\n\n### convert.sh\n\nConverts any audio files in `original_audio` into a .wav file using default ffmpeg conversion and deletes originals.\n\n#### Usage\n\n`./convert.sh`\n\n### filters.json\n\nJSON formatted list of ffmpeg audio filters\n\n### config.json\n\nConfiguration file for `apply_filters.py` and `mse.py`\n\n| key                 | default         | description                                                                   |\n|---------------------|-----------------|-------------------------------------------------------------------------------|\n| filters_filename    | filters.json    | filename of JSON formatted filters list in                                    |\n| segment_len         | 262144          | number of audio samples in each analyzed segment                              |\n| sample_skips        | 262144          | number of samples skipped between beginnings of analyzed segments             |\n| bit_depth           | 16              | bit depth of analyzed audio                                                   |\n| original_audio_dir  | original_audio  | relative path to search for original audio                                    |\n| filtered_audio_dir  | filtered_audio  | relative path of filtered audio                                               |\n| output_filename     | output.json     | filename of JSON formatted mean square error output                           |\n\n### config.py\n\nDefines `CONFIG_FILENAME`, `Config` class, and associated JSON loader function (`load_config`).\n\n### apply_filters.py\n\nLoads configuration from `CONFIG_FILENAME`, applies list of ffmpeg audio filters from `filters_filename` to .wav files in `original_audio_dir` and writes resulting audio files to `filtered_audio_dir`.\n\n#### Usage\n\n`python3 apply_filters.py`\n\n### mse.py\n\nLoads configuration from `CONFIG_FILENAME` and calculates the average MSE of sequences of length `sequence_len` in the temporal domain and frequency domain ([DCT-II](https://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II)) between original audio segments and their filtered counterparts. Resulting MSEs are dumped to `output_filename` in JSON format.\n\n#### Usage\n\n`python3 mse.py`\n\n### visualize.py\n\nLoads configuration from `CONFIG_FILENAME`, read MSE outputs from `output_filename` and plot the results as bar graphs.\n\n## Example Results\n\nThe following results were calculated from 3 hours of audio extracted from a Twitch VOD.\n\n| filter      | MSE (temporal domain) | MSE (frequency domain) |\n|-------------|-----------------------|------------------------|\n| acompressor | 419.5447047722049     | 769325.3616135248      |\n| acrusher    | 128.31195087665463    | 788.4744883700115      |\n| aecho       | 1973.808181613829     | 11476890.952585308     |\n| aphaser     | 2140.157159476164     | 7514830.79328153       |\n| alimiter    | 1589.4807644937096    | 33103402.4035865       |\n\n### Temporal Domain MSE\n\n\u003cimg src=\"https://github.com/hrichharms/ffmpeg_filters_mse/blob/master/figures/Temporal_Mean_Square_Error_(MSE).png?raw=true\" alt=\"Mean Squared Error in the Temporal Domain\" width=\"400\"/\u003e\n\n### Frequency Domain MSE\n\n\u003cimg src=\"https://github.com/hrichharms/ffmpeg_filters_mse/blob/master/figures/Frequency_Mean_Square_Error_(MSE).png?raw=true\" alt=\"Mean Squared Error in the Frequency Domain\" width=\"400\"/\u003e\n\n## TODO\n- Add more audio filters\n- Add better documentation for example results\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrichharms%2Fffmpeg_filters_mse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrichharms%2Fffmpeg_filters_mse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrichharms%2Fffmpeg_filters_mse/lists"}