{"id":25222765,"url":"https://github.com/hexxone/simple-media-scanner","last_synced_at":"2026-05-01T08:31:51.552Z","repository":{"id":276647396,"uuid":"929856967","full_name":"hexxone/simple-media-scanner","owner":"hexxone","description":"Docker-based Python application that uses FFmpeg to scan media files for corruptions and errors.","archived":false,"fork":false,"pushed_at":"2025-06-09T14:00:50.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-24T02:38:16.242Z","etag":null,"topics":["docker","docker-compose","ffmpeg","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"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/hexxone.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,"zenodo":null}},"created_at":"2025-02-09T15:13:13.000Z","updated_at":"2025-06-08T12:50:17.000Z","dependencies_parsed_at":"2025-06-05T11:48:13.377Z","dependency_job_id":null,"html_url":"https://github.com/hexxone/simple-media-scanner","commit_stats":null,"previous_names":["hexxone/simple-media-scanner"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hexxone/simple-media-scanner","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexxone%2Fsimple-media-scanner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexxone%2Fsimple-media-scanner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexxone%2Fsimple-media-scanner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexxone%2Fsimple-media-scanner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hexxone","download_url":"https://codeload.github.com/hexxone/simple-media-scanner/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hexxone%2Fsimple-media-scanner/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32490810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","docker-compose","ffmpeg","python"],"created_at":"2025-02-10T23:42:29.583Z","updated_at":"2026-05-01T08:31:51.546Z","avatar_url":"https://github.com/hexxone.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Simple Media Scanner\n\nA Docker-based Python application that uses FFmpeg to scan media files for corruptions and errors.\n\nThe scanner maintains progress between runs and provides detailed error logging for problematic files.\n\n## Features\n\n- **Automated Media Scanning**: Recursively scans directories for media files\n- **Error Detection**: Uses FFmpeg to detect corruption and errors in media files\n- **Progress Tracking**: Maintains scan progress between runs\n- **Detailed Logging**: JSON-formatted logs for easy parsing and analysis\n- **Docker Support**: Runs in a containerized environment\n- **Progress Visualization**: Real-time progress bar during scanning\n- **Skip Already Scanned**: Efficiently skips previously validated files\n- **Summary Reports**: Provides detailed scan summary upon completion\n\n## Supported Media Formats\n\n- MP4 (.mp4)\n- Matroska (.mkv)\n- AVI (.avi)\n- QuickTime (.mov)\n- Windows Media (.wmv)\n- Flash Video (.flv)\n- M4V (.m4v)\n- MPEG (.mpg, .mpeg)\n- M2TS (.m2ts)\n\n## Prerequisites\n\n- Docker\n- Docker Compose\n- Sufficient disk space for media files\n- Read access to media directory\n\n## Installation\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/hexxone/simple-media-scanner.git\ncd simple-media-scanner\n```\n\n2. Build and run with Docker Compose:\n\n```bash\ndocker compose up -d --build\n```\n\n## Configuration\n\n### Environment Variables\n\nThe following environment variables can be configured in `docker-compose.yml`:\n\n- `MEDIA_PATH`: Path to media directory inside container (default: `/media`)\n- `LOG_PATH`: Path to log directory inside container (default: `/app/logs`)\n\n### Volume Mounts\n\nThe default `docker-compose.yml` includes two volume mounts:\n- `./media:/media` - Your media directory\n- `./logs:/app/logs` - Local logs directory\n\nModify these in `docker-compose.yml` according to your needs.\n\n## Project Structure\n\n```\nmedia-scanner/\n├── docker-compose.yml\n├── Dockerfile\n├── README.md\n├── requirements.txt\n├── src/\n│   ├── media_scanner.py\n│   └── progress_tracker.py\n└── logs/\n    └── .gitkeep\n```\n\n## How It Works\n\n1. **Initialization**\n   - Loads progress from previous scans\n   - Sets up JSON logging\n   - Prepares FFmpeg environment\n\n2. **File Discovery**\n   - Recursively searches for media files\n   - Filters by supported file extensions\n   - Creates list of files to process\n\n3. **Scanning Process**\n   - Checks progress tracker for previously scanned files\n   - Uses FFmpeg to analyze each file\n   - Updates progress after each file\n   - Logs errors for corrupted files\n\n4. **Progress Tracking**\n   - Maintains JSON file with scan history\n   - Records timestamp of last scan\n   - Tracks scan status for each file\n\n5. **Error Logging**\n   - Creates timestamped log files\n   - Logs only problematic files\n   - Uses JSON format for structured logging\n\n## Logs\n\n### Error Logs\n\nLocated in `logs/media_scan_errors_YYYYMMDD_HHMMSS.log`\n```json\n{\n  \"timestamp\": \"2024-02-09T12:00:00.000Z\",\n  \"level\": \"ERROR\",\n  \"file\": \"/media/example.mp4\",\n  \"error\": \"Error detail message\"\n}\n```\n\n### Progress File\n\nLocated in `logs/progress.json`\n```json\n{\n  \"/media/example.mp4\": {\n    \"last_scan\": \"2024-02-09T12:00:00.000Z\",\n    \"status\": \"ok\"\n  }\n}\n```\n\n## Output\n\nThe scanner provides real-time progress information and a summary upon completion:\n\n```\nStarting media scan in: /media\nScanning files: 100%|██████████| 150/150 [00:30\u003c00:00, 5.00 files/s]\n\nScan Summary:\nTotal files processed: 150\nFiles scanned: 100\nFiles skipped (already scanned): 50\nFiles with errors: 3\nError log location: /app/logs\n```\n\n## Development\n\n### Adding New Media Formats\n\nTo add support for additional media formats, modify the `media_extensions` set in `src/media_scanner.py`:\n\n```python\nself.media_extensions = {\n    '.mp4', '.mkv', '.avi',  # existing formats\n    '.new_format'  # add new format here\n}\n```\n\n### Custom Error Checking\n\nThe FFmpeg error checking can be customized by modifying the `scan_file` method in `src/media_scanner.py`.\n\n### Linting\n\n- `pip install pylint`\n- `pylint $(git ls-files '*.py')`\n\n## Troubleshooting\n\n### Common Issues\n\n1. **Permission Denied**\n   - Ensure proper read permissions on media directory\n   - Check Docker user permissions\n\n2. **FFmpeg Errors**\n   - Verify FFmpeg installation in container\n   - Check FFmpeg version compatibility\n\n3. **Progress File Corruption**\n   - Delete `logs/progress.json` to reset progress\n   - Restart the container\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit your changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\n[MIT License](LICENSE)\n\n## Author\n\n- [hexxone](https://github.com/hexxone)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexxone%2Fsimple-media-scanner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhexxone%2Fsimple-media-scanner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhexxone%2Fsimple-media-scanner/lists"}