{"id":31029004,"url":"https://github.com/codenlighten/ffmpeg_tools","last_synced_at":"2025-09-13T21:56:25.985Z","repository":{"id":313511570,"uuid":"1051653111","full_name":"codenlighten/ffmpeg_tools","owner":"codenlighten","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-06T14:03:10.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-06T16:06:40.912Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/codenlighten.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-06T12:57:18.000Z","updated_at":"2025-09-06T14:03:13.000Z","dependencies_parsed_at":"2025-09-06T16:06:44.475Z","dependency_job_id":"87d749b7-c7ea-4a28-ac44-71e24fbe1d1f","html_url":"https://github.com/codenlighten/ffmpeg_tools","commit_stats":null,"previous_names":["codenlighten/ffmpeg_tools"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/codenlighten/ffmpeg_tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fffmpeg_tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fffmpeg_tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fffmpeg_tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fffmpeg_tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codenlighten","download_url":"https://codeload.github.com/codenlighten/ffmpeg_tools/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codenlighten%2Fffmpeg_tools/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275032807,"owners_count":25393761,"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","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"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":[],"created_at":"2025-09-13T21:56:23.173Z","updated_at":"2025-09-13T21:56:25.976Z","avatar_url":"https://github.com/codenlighten.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FFmpeg Server Tools\n\nA comprehensive set of FFmpeg server tools for media processing with a modern web interface and RESTful API.\n\n## Features\n\n### Core Functionality\n- **File Upload**: Drag \u0026 drop or browse to upload video/audio files\n- **Media Conversion**: Convert between various formats (MP4, AVI, MOV, WebM, MKV, GIF, MP3, WAV, AAC, FLAC, etc.)\n- **Video Editing**: Trim videos and merge multiple files\n- **Media Information**: Extract detailed metadata from media files\n- **Real-time Progress**: WebSocket-based progress tracking for long-running operations\n- **Job Management**: Track and monitor all processing jobs\n- **Batch Processing**: Handle multiple files simultaneously\n\n### Technical Features\n- **RESTful API**: Complete API for programmatic access\n- **Web Interface**: Modern, responsive UI with drag \u0026 drop support\n- **Security**: Rate limiting, file type validation, and security headers\n- **Auto Cleanup**: Automatic cleanup of old files (configurable)\n- **Error Handling**: Comprehensive error handling and user feedback\n\n## Installation\n\n### Prerequisites\n- Node.js (v14 or higher)\n- FFmpeg installed on your system\n\n### Install FFmpeg\n\n#### Ubuntu/Debian\n```bash\nsudo apt update\nsudo apt install ffmpeg\n```\n\n#### macOS\n```bash\nbrew install ffmpeg\n```\n\n#### Windows\nDownload from [https://ffmpeg.org/download.html](https://ffmpeg.org/download.html)\n\n### Setup Project\n```bash\n# Clone or download the project\ncd ffmpeg-server-tools\n\n# Install dependencies\nnpm install\n\n# Start the server\nnpm start\n\n# For development (with auto-restart)\nnpm run dev\n```\n\n## Usage\n\n### Web Interface\n1. Open your browser and go to `http://localhost:3000`\n2. Use the tabs to navigate between different functions:\n   - **Upload**: Upload your media files\n   - **Convert**: Convert files to different formats\n   - **Edit**: Trim videos or merge multiple files\n   - **Info**: Get detailed media information\n   - **Jobs**: Monitor processing jobs\n\n### API Endpoints\n\n#### File Operations\n- `POST /api/upload` - Upload a file\n- `GET /api/files` - List uploaded files\n- `GET /api/download/:filename` - Download output file\n\n#### Media Processing\n- `POST /api/convert` - Convert media file\n- `POST /api/trim` - Trim video\n- `POST /api/merge` - Merge multiple videos\n- `GET /api/info/:filename` - Get media information\n\n#### Job Management\n- `GET /api/job/:jobId` - Get job status\n- `GET /api/jobs` - List all jobs\n\n#### Health Check\n- `GET /api/health` - Server health status\n\n### API Examples\n\n#### Upload a file\n```bash\ncurl -X POST -F \"file=@video.mp4\" http://localhost:3000/api/upload\n```\n\n#### Convert a file\n```bash\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"inputFile\": \"video.mp4\",\n    \"outputFormat\": \"webm\",\n    \"options\": {\n      \"videoCodec\": \"libvpx-vp9\",\n      \"videoBitrate\": \"1000k\",\n      \"resolution\": \"1280x720\"\n    }\n  }' \\\n  http://localhost:3000/api/convert\n```\n\n#### Trim a video\n```bash\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"inputFile\": \"video.mp4\",\n    \"startTime\": \"00:00:30\",\n    \"duration\": \"00:01:00\"\n  }' \\\n  http://localhost:3000/api/trim\n```\n\n#### Get media information\n```bash\ncurl http://localhost:3000/api/info/video.mp4\n```\n\n#### Convert video to GIF\n```bash\ncurl -X POST \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"inputFile\": \"video.mp4\",\n    \"outputFormat\": \"gif\",\n    \"options\": {\n      \"resolution\": \"320x240\"\n    }\n  }' \\\n  http://localhost:3000/api/convert\n```\n\n## Configuration\n\n### Environment Variables\n- `PORT` - Server port (default: 3000)\n- `NODE_ENV` - Environment (development/production)\n\n### File Limits\n- Maximum file size: 500MB (configurable in server.js)\n- Supported formats: MP4, AVI, MOV, WMV, FLV, WebM, MKV, GIF, MP3, WAV, AAC, FLAC, OGG\n\n### GIF Conversion\n- Automatically optimized for smaller file sizes (10fps, 320px width)\n- Best for short video clips (recommended: under 30 seconds)\n- Use lower resolutions for faster processing and smaller files\n\n### Cleanup Schedule\n- Old files are automatically cleaned up daily at midnight\n- Files older than 7 days are removed (configurable)\n\n## Directory Structure\n```\nffmpeg-server-tools/\n├── server.js              # Main server file\n├── package.json           # Dependencies and scripts\n├── public/                # Web interface files\n│   ├── index.html         # Main HTML file\n│   ├── styles.css         # Styles\n│   └── app.js            # Frontend JavaScript\n├── uploads/              # Uploaded files (auto-created)\n├── outputs/              # Processed files (auto-created)\n├── temp/                 # Temporary files (auto-created)\n└── README.md            # This file\n```\n\n## WebSocket Connection\n\nThe server provides real-time progress updates via WebSocket on the same port as the HTTP server:\n\n```javascript\n// WebSocket automatically connects to the same host and port as the web page\nconst protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';\nconst wsUrl = `${protocol}//${window.location.host}`;\nconst ws = new WebSocket(wsUrl);\n\n## Security Features\n\n- **Rate Limiting**: 100 requests per 15 minutes per IP\n- **File Type Validation**: Only allows media files\n- **File Size Limits**: Configurable maximum file size\n- **Security Headers**: Helmet.js for security headers\n- **CORS**: Cross-origin resource sharing enabled\n\n## Error Handling\n\nThe API returns appropriate HTTP status codes and error messages:\n- `400` - Bad Request (missing parameters, invalid file type)\n- `404` - Not Found (file not found)\n- `500` - Internal Server Error (processing errors)\n\n## Development\n\n### Running Tests\n```bash\nnpm test\n```\n\n### Development Mode\n```bash\nnpm run dev\n```\n\nThis starts the server with nodemon for automatic restarts on file changes.\n\n## Troubleshooting\n\n### Common Issues\n\n1. **FFmpeg not found**\n   - Ensure FFmpeg is installed and available in PATH\n   - Test with `ffmpeg -version`\n\n2. **File upload fails**\n   - Check file size limits\n   - Verify file format is supported\n\n3. **WebSocket connection fails**\n   - WebSocket runs on the same port as HTTP server (port 3000)\n   - Check Content Security Policy if using custom deployment\n   - Ensure WebSocket protocol matches (ws:// for HTTP, wss:// for HTTPS)\n\n4. **Processing jobs fail**\n   - Check server logs for detailed error messages\n   - Verify input file integrity\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests if applicable\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details.\n\n## Support\n\nFor issues and questions:\n1. Check the troubleshooting section\n2. Review server logs\n3. Open an issue on the project repository\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fffmpeg_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodenlighten%2Fffmpeg_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodenlighten%2Fffmpeg_tools/lists"}