{"id":19905314,"url":"https://github.com/jonaylor89/cyberpunk-rs","last_synced_at":"2025-06-12T16:36:05.001Z","repository":{"id":101841532,"uuid":"559670787","full_name":"jonaylor89/cyberpunk-rs","owner":"jonaylor89","description":"Cyberpunk POC using ffmpeg written in rust","archived":false,"fork":false,"pushed_at":"2024-09-21T15:52:08.000Z","size":6069,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-11T21:41:43.303Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","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/jonaylor89.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-10-30T20:23:01.000Z","updated_at":"2024-09-21T15:52:12.000Z","dependencies_parsed_at":"2024-03-30T15:32:59.655Z","dependency_job_id":null,"html_url":"https://github.com/jonaylor89/cyberpunk-rs","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/jonaylor89%2Fcyberpunk-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaylor89%2Fcyberpunk-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaylor89%2Fcyberpunk-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonaylor89%2Fcyberpunk-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonaylor89","download_url":"https://codeload.github.com/jonaylor89/cyberpunk-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241335517,"owners_count":19946068,"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":[],"created_at":"2024-11-12T20:32:31.340Z","updated_at":"2025-06-12T16:36:04.968Z","avatar_url":"https://github.com/jonaylor89.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cyberpunk\n\nAdvanced Audio Processing Server for on the fly audio manipulation\n\n![GitHub](https://img.shields.io/github/license/jonaylor89/cyberpunk-rs?logo=MIT) ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/jonaylor89/cyberpunk-rs/Docker)\n\n[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/jonaylor89/cyberpunk-rs)\n\n## Quick Start\n\n### Local Development\n```sh\ncargo run\n```\n\n### Docker\n```sh\ndocker run -p 8080:8080 -e PORT=8080 ghcr.io/jonaylor89/cyberpunk-rs:main\n```\n\n### Google Cloud Run (One-click deploy)\n[![Run on Google Cloud](https://deploy.cloud.run/button.svg)](https://deploy.cloud.run?git_repo=https://github.com/jonaylor89/cyberpunk-rs)\n\n### MCP Integration (Connect to LLMs)\n```sh\n# Start server, then in another terminal:\nnpx @cyberpunk-rs/mcp-server\n\n# Or connect to deployed server:\nnpx @cyberpunk-rs/mcp-server --server=https://your-app.run.app\n```\nSee [MCP_INTEGRATION.md](MCP_INTEGRATION.md) for Claude Desktop setup.\n\nOriginal audio test file:\n```\nhttps://raw.githubusercontent.com/jonaylor89/cyberpunk-rs/main/testdata/celtic_pt2.mp3\n```\n\nTry out the following audio manipulation requests:\n```\nhttp://localhost:8080/unsafe/https://raw.githubusercontent.com/jonaylor89/cyberpunk-rs/main/testdata/celtic_pt2.mp3\nhttp://localhost:8080/unsafe/https://raw.githubusercontent.com/jonaylor89/cyberpunk-rs/main/testdata/celtic_pt2.mp3?reverse=true\nhttp://localhost:8080/unsafe/https://raw.githubusercontent.com/jonaylor89/cyberpunk-rs/main/testdata/celtic_pt2.mp3?start_time=0\u0026duration=10\nhttp://localhost:8080/unsafe/https://raw.githubusercontent.com/jonaylor89/cyberpunk-rs/main/testdata/celtic_pt2.mp3?reverse=true\u0026fade_in=1\u0026fade_out=1\u0026speed=0.8\n```\n\n## Cyberpunk API\n\nThe Cyberpunk endpoint follows this URL structure:\n\n```\n/HASH|unsafe/AUDIO?param1=value1\u0026param2=value2\u0026...\n```\n\n- `HASH` is the URL signature hash, or `unsafe` if unsafe mode is used\n- `AUDIO` is the audio URI (local file or remote URL)\n\n### Supported Parameters\n\nCyberpunk supports a wide range of audio processing capabilities:\n\n#### Format \u0026 Encoding\n- `format` - Output format (mp3, wav, etc.)\n- `codec` - Audio codec\n- `sample_rate` - Sample rate in Hz\n- `channels` - Number of audio channels\n- `bit_rate` - Bit rate in kbps\n- `bit_depth` - Bit depth\n- `quality` - Encoding quality (0.0-1.0)\n- `compression_level` - Compression level\n\n#### Time Operations\n- `start_time` - Start time in seconds\n- `duration` - Duration in seconds\n- `speed` - Playback speed multiplier\n- `reverse` - Reverse audio (true/false)\n\n#### Volume Operations\n- `volume` - Volume adjustment multiplier\n- `normalize` - Normalize audio levels (true/false)\n- `normalize_level` - Target normalization level in dB\n\n#### Audio Effects\n- `lowpass` - Lowpass filter cutoff frequency\n- `highpass` - Highpass filter cutoff frequency\n- `bandpass` - Bandpass filter parameters\n- `bass` - Bass boost/cut level\n- `treble` - Treble boost/cut level\n- `echo` - Echo effect parameters\n- `chorus` - Chorus effect parameters\n- `flanger` - Flanger effect parameters\n- `phaser` - Phaser effect parameters\n- `tremolo` - Tremolo effect parameters\n- `compressor` - Compressor effect parameters\n- `noise_reduction` - Noise reduction parameters\n\n#### Fades\n- `fade_in` - Fade in duration in seconds\n- `fade_out` - Fade out duration in seconds\n- `cross_fade` - Cross-fade duration in seconds\n\n#### Advanced\n- `custom_filters` - Custom FFmpeg filter parameters\n- `custom_options` - Custom FFmpeg options\n- `tags` - Metadata tags (as `tag_NAME=VALUE`)\n\n### Preview Parameters with `/params`\n\nYou can preview the parameters for any request by adding `/params` before the endpoint:\n\n```sh\ncurl \"http://localhost:8080/params/unsafe/celtic_pt2.mp3?reverse=true\u0026fade_in=1\"\n\n{\n  \"audio\": \"celtic_pt2.mp3\",\n  \"reverse\": true,\n  \"fade_in\": 1.0\n}\n```\n\n### Audio Metadata with `/meta`\n\nYou can extract audio metadata by adding `/meta` before the endpoint:\n\n```sh\ncurl \"http://localhost:8080/meta/unsafe/celtic_pt2.mp3\"\n\n{\n  \"format\": \"mp3\",\n  \"duration\": 27.4808,\n  \"bit_rate\": 161192,\n  \"sample_rate\": 44100,\n  \"channels\": 2,\n  \"codec\": \"mp3\",\n  \"size\": 553712,\n  \"tags\": {\n    \"iTunSMPB\": \"...\",\n    \"TSS\": \"Logic Pro X 10.3.3\",\n    \"iTunNORM\": \"...\"\n  }\n}\n```\n\n## Storage Options\n\nCyberpunk supports multiple storage backends:\n\n- [x] Local File System\n- [x] AWS S3 / MinIO\n- [x] Google Cloud Storage (GCS)\n- [_] Decentralized Storage (IPFS, Audius)\n\n## Advanced Features\n\n- [x] Audio format conversion\n- [x] Audio time manipulation (slicing, speed, reverse)\n- [x] Audio effects and filters\n- [x] Audio fades\n- [x] Request caching\n- [x] Storage abstraction\n- [x] Metrics and monitoring\n- [x] Remote audio fetching\n\n\n## Configuration\n\nCyberpunk-rs uses a flexible configuration system combining YAML configuration files and environment variables.\n\n### Configuration Files\n\nThe configuration files are structured as follows:\n- `config/base.yml` - Base configuration applied to all environments\n- `config/local.yml` - Development environment configuration\n- `config/production.yml` - Production environment configuration\n\nYou can select which environment to use by setting the `APP_ENVIRONMENT` environment variable to either `local` or `production`.\n\n### Configuration Structure\n\n#### Application Settings\n```yaml\napplication:\n  port: 8080                         # Port the server listens on\n  host: \"127.0.0.1\"                  # Host the server binds to\n  hmac_secret: \"your-secret-key\"     # Secret for URL signing\n```\n\n#### Storage Settings\n```yaml\nstorage:\n  base_dir: \"/path/to/storage\"       # Base directory for file storage\n  path_prefix: \"audio/\"              # Prefix for storage paths\n  safe_chars: \"default\"              # Character sanitization mode\n  client:                            # Optional storage client configuration\n    # S3 Storage Configuration\n    S3:\n      region: \"us-east-1\"\n      bucket: \"my-bucket\"\n      endpoint: \"https://s3.amazonaws.com\"  # S3-compatible endpoint URL\n      access_key: \"access-key\"\n      secret_key: \"secret-key\"\n\n    # Or Google Cloud Storage Configuration\n    GCS:\n      bucket: \"my-gcs-bucket\"\n```\n\n#### Processor Settings\n```yaml\nprocessor:\n  disabled_filters: []               # List of disabled audio filters\n  max_filter_ops: 256               # Maximum number of filter operations\n  concurrency: 4                    # Concurrent processing threads (null = auto)\n  max_cache_files: 1000             # Maximum number of cached files\n  max_cache_mem: 256                # Maximum memory used for caching (MB)\n  max_cache_size: 1024              # Maximum cache size (MB)\n```\n\n#### Cache Settings\n```yaml\ncache:\n  # Redis Cache Configuration\n  Redis:\n    uri: \"redis://localhost:6379\"\n\n  # Or Filesystem Cache Configuration\n  Filesystem:\n    base_dir: \"/path/to/cache\"      # Cache directory\n```\n\n#### Custom Tags\n```yaml\ncustom_tags:\n  env: \"production\"                 # Custom metadata tags\n  version: \"1.0.0\"\n```\n\n### Environment Variables\n\nAll configuration options can also be set using environment variables with the following format:\n`APP_SECTION__KEY=value`\n\nFor example:\n- `APP_APPLICATION__PORT=8080`\n- `APP_STORAGE__BASE_DIR=/path/to/storage`\n- `APP_CACHE__FILESYSTEM__BASE_DIR=/path/to/cache`\n\nEnvironment variables take precedence over values defined in the configuration files.\n\n### Example: Local Development Configuration\n\n```yaml\napplication:\n  host: 127.0.0.1\n  base_url: \"http://127.0.0.1\"\nstorage:\n  base_dir: /path/to/project\n  path_prefix: testdata/\ncustom_tags:\n  env: local\nprocessor:\n  max_filter_ops: 256\n  concurrency: 1\ncache:\n  filesystem:\n    base_dir: /path/to/project/cache\n```\n\n### Example: Production Configuration\n\n```yaml\napplication:\n  host: 0.0.0.0  # Listen on all interfaces\n  hmac_secret: ${CYBERPUNK_SECRET}  # Use environment variable for secret\nstorage:\n  client:\n    S3:\n      region: ${AWS_REGION}\n      bucket: ${S3_BUCKET}\n      access_key: ${AWS_ACCESS_KEY_ID}\n      secret_key: ${AWS_SECRET_ACCESS_KEY}\nprocessor:\n  concurrency: 8  # Use more concurrent threads in production\ncache:\n  Redis:\n    uri: ${REDIS_URL}\ncustom_tags:\n  env: production\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaylor89%2Fcyberpunk-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonaylor89%2Fcyberpunk-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonaylor89%2Fcyberpunk-rs/lists"}