{"id":34066899,"url":"https://github.com/alexandrosstergiou/video2spectrogram","last_synced_at":"2026-04-02T00:38:50.976Z","repository":{"id":62587389,"uuid":"422179908","full_name":"alexandrosstergiou/video2spectrogram","owner":"alexandrosstergiou","description":"Python script for extracting audio from video files and creating Mel spectrograms","archived":false,"fork":false,"pushed_at":"2021-10-28T11:41:44.000Z","size":18,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-28T00:36:56.374Z","etag":null,"topics":["audio-extractor","audio-processing","spectrogram","wav"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/video2spectrogram/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexandrosstergiou.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}},"created_at":"2021-10-28T11:37:12.000Z","updated_at":"2025-05-31T22:28:39.000Z","dependencies_parsed_at":"2022-11-04T07:32:38.091Z","dependency_job_id":null,"html_url":"https://github.com/alexandrosstergiou/video2spectrogram","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/alexandrosstergiou/video2spectrogram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrosstergiou%2Fvideo2spectrogram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrosstergiou%2Fvideo2spectrogram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrosstergiou%2Fvideo2spectrogram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrosstergiou%2Fvideo2spectrogram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexandrosstergiou","download_url":"https://codeload.github.com/alexandrosstergiou/video2spectrogram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexandrosstergiou%2Fvideo2spectrogram/sbom","scorecard":{"id":180687,"data":{"date":"2025-08-11","repo":{"name":"github.com/alexandrosstergiou/video2spectrogram","commit":"847eb851dc24e3a4b2535a4f953c86b2ba0722e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/2 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T18:48:50.064Z","repository_id":62587389,"created_at":"2025-08-16T18:48:50.064Z","updated_at":"2025-08-16T18:48:50.064Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31293461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-extractor","audio-processing","spectrogram","wav"],"created_at":"2025-12-14T06:54:06.382Z","updated_at":"2026-04-02T00:38:50.955Z","avatar_url":"https://github.com/alexandrosstergiou.png","language":"Python","readme":"# video2spectrogram\n\n![supported versions](https://img.shields.io/badge/python-3.x-green.svg)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=dataset2database\u0026video\u0026to\u0026sql\u0026converter\u0026url=https://github.com/alexandrosstergiou/dataset2database\u0026hashtags=VideoConverter)\n----------------------\nAbout\n----------------------\n\nThis package is meant to automate the process of extracting audio files from videos and saving the plots computed from these audio frequencies in the Mel scale ([Sectrogram](https://en.wikipedia.org/wiki/Spectrogram)). Videos are processed in parallel with the audio extracted by `ffmpeg` stored in `.wav` files which are then used to create spectrograms stored as `.JPEG` and can be used by any audio-based method.\n\nCurrently supported video formats include `.mp4`,`mpeg-4`,`.avi`,`.wmv`. If you have a different extension, you can simply change the script to include them (in the `video2spectrogram/get_spectrogram.py`)\n\n----------------------\nPackage requirements\n----------------------\n+ `librosa`\n+ `numpy`\n+ `matplotlib`\n\nMake sure that the above packages are installed before running any functions.\n\n**`ffmpeg`**: You will need to have installed `ffmpeg` in order to perform the audio extraction from the video files.\n\n**Multiprocessing:** The code uses multiprocessing for improving speeds, thus the total time required for the conversion varies across different processors. The code has been tested on an AMD Ryzen 3950X with an average conversion time of 4 minutes for ~1K videos (with an average resolution of 480p and length of 5s.)\n\n\n----------------------\nDataset structure\n----------------------\n\nThe package assumes a fixed video dataset structure:\n\n```\n\u003cdataset\u003e    \n  │\n  └──\u003cclass 1\u003e\n  │     │\n  │     │─── \u003cvideo_1.mp4\u003e\n  │     │─── \u003cvideo_2.mp4\u003e\n  │     │─── ...\n  │    ...      \n  │\n  └───\u003cclass 2\u003e\n  │      │\n  │      │─── \u003cvideo_1.mp4\u003e\n  │      │─── \u003cvideo_2.mp4\u003e\n  │      │─── ...\n ...    ...\n\n```\n\n----------------------\nUsage\n----------------------\n\nThe main code is at the `get_spectrograme.py` file. To run the convertor simply call the `convert` function with the base directory of the dataset and the destination directory for where to save the audio.\nAdditional arguments that can be used:\n+ `verbose_lvl`: Integer for verbosity.\n+ `save_wav`: Boolean to determine if the created wav files are to be stored and not deleted.\n+ `ar`: Integer for the ffmpeg option for specifying the audio sampling frequency.\n+ `res_h`: Integer for the height of the spectrogram image to be saved.\n+ `res_w`: Integer for the width of the spectrogram image to be saved.\n+ `dpi`: Integer for the display's dot's per inch. Needs to be set to avoid inconsistencies to the `res` argument.\n\n```python\nfrom video2spectrogram import convert\n#or\nfrom get_spectrogram import convert\n\nconvert(my_dataset_dir, my_target_dir)\n\n```\n\n-------------------------\nInstallation through git\n-------------------------\n\nPlease make sure, Git is installed in your machine:\n```\n$ sudo apt-get update\n$ sudo apt-get install git\n$ git clone https://github.com/alexandrosstergiou/video2spectrogram.git\n$ cd dataset2database\n$ pip install .\n```\n\nYou can then use it as any other package installed through pip.\n\n-------------------------\nInstallation through pip\n-------------------------\n\nThe latest stable release is also available for download through pip\n```\n$ pip install video2spectrogram\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrosstergiou%2Fvideo2spectrogram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexandrosstergiou%2Fvideo2spectrogram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexandrosstergiou%2Fvideo2spectrogram/lists"}