{"id":26570172,"url":"https://github.com/pando85/gearr","last_synced_at":"2025-03-22T21:49:26.745Z","repository":{"id":215640180,"uuid":"736223345","full_name":"pando85/gearr","owner":"pando85","description":"A versatile video transcoding tool specialized in converting media files to the efficient x265 format.","archived":false,"fork":false,"pushed_at":"2024-04-13T10:06:23.000Z","size":193317,"stargazers_count":79,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-14T00:31:03.095Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"segator/transcoderd","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pando85.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2023-12-27T10:12:04.000Z","updated_at":"2024-04-15T23:45:23.885Z","dependencies_parsed_at":"2024-02-11T23:28:09.986Z","dependency_job_id":"b306e99e-405e-4524-9fb6-57914d15a7bc","html_url":"https://github.com/pando85/gearr","commit_stats":null,"previous_names":["pando85/transcoderd","pando85/gearr"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pando85%2Fgearr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pando85%2Fgearr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pando85%2Fgearr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pando85%2Fgearr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pando85","download_url":"https://codeload.github.com/pando85/gearr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245025971,"owners_count":20549067,"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":"2025-03-22T21:49:26.088Z","updated_at":"2025-03-22T21:49:26.732Z","avatar_url":"https://github.com/pando85.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg height=\"24px\" src=\"./server/web/ui/public/logo.svg\" alt=\"Gearr\"\u003e\u003c/img\u003e Gearr\n\n**Warning: Use at your own risk! Gearr is currently in alpha stage and has not undergone extensive testing.**\n\nGearr is an open-source video transcoding software designed to efficiently convert videos to the x265 format. It leverages the powerful ffmpeg library under the hood to ensure high-quality transcoding. Gearr also supports distributed transcoding across multiple agents, facilitating faster processing of video files.\n\n## Features\n\n- **x265 Transcoding:** Convert videos to the x265 format for improved compression and quality.\n- **Distributed Transcoding:** Utilize multiple agents to distribute transcoding tasks, speeding up the process.\n- **Queue system:** Connect to a RabbitMQ server to manage transcoding job queues.\n- **PGS Subtitle Conversion:** Extract PGS subtitles from video files and convert them to STR format for wider compatibility.\n\n## Container Images\n\n- **Server:** `ghcr.io/pando85/gearr:latest-server`\n- **Worker:** `ghcr.io/pando85/gearr:latest-worker`\n- **PGS Worker:** `ghcr.io/pando85/gearr:latest-worker-pgs`\n\n## Configuration\n\n### Environment Variables\n\nThe application supports configuration through environment variables. Below is a table of supported\nenvironment variables and their default values:\n\n#### Server\n\n| Variable                 | Description                                           | Default Value         |\n| ------------------------ | ----------------------------------------------------- | --------------------- |\n| `BROKER_HOST`            | Broker host address                                   | localhost             |\n| `BROKER_PORT`            | Broker port                                           | 5672                  |\n| `BROKER_USER`            | Broker username                                       | broker                |\n| `BROKER_PASSWORD`        | Broker password                                       | broker                |\n| `BROKER_TASKENCODEQUEUE` | Broker tasks queue name for encoding                  | tasks                 |\n| `BROKER_TASKPGSQUEUE`    | Broker tasks queue name for PGS to SRT conversion     | tasks_pgstosrt        |\n| `BROKER_EVENTQUEUE`      | Broker tasks events queue name                        | task_events           |\n| `DATABASE_DRIVER`        | Database driver                                       | postgres              |\n| `DATABASE_HOST`          | Database host address                                 | localhost             |\n| `DATABASE_PORT`          | Database port                                         | 5432                  |\n| `DATABASE_USER`          | Database username                                     | postgres              |\n| `DATABASE_PASSWORD`      | Database password                                     | postgres              |\n| `DATABASE_DATABASE`      | Database name                                         | gearr                 |\n| `DATABASE_SSLMODE`       | Database SSL mode                                     | disable               |\n| `LOG_LEVEL`              | Log level (debug, info, warning, error, fatal)        | info                  |\n| `SCHEDULER_DOMAIN`       | Base domain for worker downloads and uploads          | http://localhost:8080 |\n| `SCHEDULER_SCHEDULETIME` | Scheduling loop execution interval                    | 5m                    |\n| `SCHEDULER_JOBTIMEOUT`   | Requeue jobs running for more than specified duration | 24h                   |\n| `SCHEDULER_DOWNLOADPATH` | Download path for workers                             | /data/current         |\n| `SCHEDULER_UPLOADPATH`   | Upload path for workers                               | /data/processed       |\n| `SCHEDULER_MINFILESIZE`  | Minimum file size for worker processing               | 100000000             |\n| `WEB_PORT`               | Web server port                                       | 8080                  |\n| `WEB_TOKEN`              | Web server token                                      | admin                 |\n\n#### Worker\n\n| Variable                   | Description                                                      | Default Value              |\n| -------------------------- | ---------------------------------------------------------------- | -------------------------- |\n| `BROKER_HOST`              | Broker host address                                              | localhost                  |\n| `BROKER_PORT`              | Broker port                                                      | 5672                       |\n| `BROKER_USER`              | Broker username                                                  | broker                     |\n| `BROKER_PASSWORD`          | Broker password                                                  | broker                     |\n| `BROKER_TASKENCODEQUEUE`   | Broker tasks queue name for encoding                             | tasks                      |\n| `BROKER_TASKPGSQUEUE`      | Broker tasks queue name for PGS to SRT conversion                | tasks_pgstosrt             |\n| `BROKER_EVENTQUEUE`        | Broker tasks events queue name                                   | task_events                |\n| `LOG_LEVEL`                | Set the log level (options: \"debug\", \"info\", \"warning\", \"error\") | info                       |\n| `WORKER_TEMPORALPATH`      | Path used for temporal data                                      | system temporary directory |\n| `WORKER_NAME`              | Worker name used for statistics                                  | hostname                   |\n| `WORKER_THREADS`           | Number of worker threads                                         | number of CPU cores        |\n| `WORKER_ACCEPTEDJOBS`      | Type of jobs the worker will accept                              | [\"encode\"]                 |\n| `WORKER_MAXPREFETCHJOBS`   | Maximum number of jobs to prefetch                               | 1                          |\n| `WORKER_ENCODEJOBS`        | Number of parallel worker jobs for encoding                      | 1                          |\n| `WORKER_PGJOBS`            | Number of parallel worker jobs for PGS to SRT conversion         | 0                          |\n| `WORKER_DOTNETPATH`        | Path to the dotnet executable                                    | \"/usr/bin/dotnet\"          |\n| `WORKER_PGSTOSRTDLLPATH`   | Path to the PGSToSrt.dll library                                 | \"/app/PgsToSrt.dll\"        |\n| `WORKER_TESSERACTDATAPATH` | Path to the tesseract data                                       | \"/tessdata\"                |\n| `WORKER_STARTAFTER`        | Accept jobs only after the specified time (format: HH:mm)        | -                          |\n| `WORKER_STOPAFTER`         | Stop accepting new jobs after the specified time (format: HH:mm) | -                          |\n| `SCHEDULER_DOMAIN`         | Base domain for worker downloads and uploads                     | http://localhost:8080      |\n| `SCHEDULER_SCHEDULETIME`   | Scheduling loop execution interval                               | 5m                         |\n| `SCHEDULER_JOBTIMEOUT`     | Requeue jobs running for more than specified duration            | 24h                        |\n| `SCHEDULER_DOWNLOADPATH`   | Download path for workers                                        | /data/current              |\n| `SCHEDULER_UPLOADPATH`     | Upload path for workers                                          | /data/processed            |\n| `SCHEDULER_MINFILESIZE`    | Minimum file size for worker processing                          | 100000000                  |\n| `WEB_PORT`                 | Web server port                                                  | 8080                       |\n| `WEB_TOKEN`                | Web server token                                                 | admin                      |\n\n### Configuration File\n\nThe application also supports configuration through a YAML file. The default configuration file\nformat is YAML. If you want to use a different file format, please specify it in the `CONFIG_FILE`\nenvironment variable.\n\nExample YAML configuration file:\n\n#### Server\n\n```yaml\nlogLevel: info\n\nbroker:\n  host: localhost\n  port: 5672\n  user: broker\n  password: broker\n  taskEncodeQueue: tasks\n  taskPGSQueue: tasks_pgstosrt\n  eventQueue: task_events\n\ndatabase:\n  Driver: postgres\n  Host: localhost\n  port: 5432\n  User: postgres\n  Password: postgres\n  Database: gearr\n  SSLMode: disable\n\nscheduler:\n  domain: http://localhost:8080\n  scheduleTime: 5m\n  jobTimeout: 24h\n  downloadPath: /data/current\n  uploadPath: /data/processed\n  minFileSize: 100000000\n\nweb:\n  port: 8080\n  token: admin\n```\n\n#### Worker\n\n```yaml\nbroker:\n  host: localhost\n  port: 5672\n  user: broker\n  password: broker\n  taskEncodeQueue: tasks\n  taskPGSQueue: tasks_pgstosrt\n  eventQueue: task_events\n\nlogLevel: info\n\nworker:\n  temporalPath: /path/to/temp/data\n  name: my-worker\n  threads: 4\n  acceptedJobs:\n    - encode\n  maxPrefetchJobs: 2\n  encodeJobs: 2\n  pgJobs: 1\n  dotnetPath: /usr/local/bin/dotnet\n  pgsToSrtDLLPath: /custom/path/PgsToSrt.dll\n  tesseractDataPath: /custom/tessdata\n  startAfter: \"08:00\"\n  stopAfter: \"17:00\"\n```\n\n## Client Execution\n\n### Worker\n\n```bash\nDIR=/data/images/encode\n\nmkdir -p $DIR\ndocker run -it -d --restart unless-stopped --cpuset-cpus 16-32 \\\n    --name gearr-worker --hostname $(hostname) \\\n    -v $DIR:/tmp/ ghcr.io/pando85/gearr:latest-worker \\\n    --broker.host gearr.example.com\n```\n\n**Note:** Adjust the `--cpuset-cpus` and other parameters according to your system specifications.\n\n### PGS Worker\n\n```bash\nDIR=/data/images/pgs\n\nmkdir -p $DIR\ndocker run -it -d --restart unless-stopped \\\n    --name gearr-worker-pgs --hostname $(hostname) \\\n    -v $DIR:/tmp/ ghcr.io/pando85/gearr:latest-worker-pgs \\\n    --broker.host gearr.example.com\n```\n\n**Warning:** The PGS agent must be started in advance if PGS is detected. It should run before\ndetection to create the RabbitMQ queue.\n\n## Integrations\n\n### Add movies from Radarr\n\n```bash\ngo run ./integrations/radarr/add/main.go --api-key XXXXXX --url https://radarr.example.com --movies 5 --gearr-url 'https://gearr.example.com' --gearr-token XXXXXX\n```\n\nFeel free to customize the parameters based on your Radarr and Gearr setup.\n\n### Update movies in Radarr\n\nIn your radarr server:\n\n```bash\nMOVIDES_DIR=/movies\nfind ${MOVIES_DIR} -name '*_encoded.mkv'\n```\n\nThen execute:\n\n```bash\ngo run ./integrations/radarr/update/main.go --api-key XXXXXX --url https://radarr.example.com \"${FIND_OUTPUT}\"\n```\n\nThen you can go to Radarr: `Edit Movies -\u003e Select All -\u003e Rename Files`\n\n### Add episodes from Sonarr\n\n```bash\ngo run ./integrations/sonarr/add/main.go --api-key XXXXXX --url https://sonarr.example.com --series 5  --episodes 10 --gearr-url 'https://gearr.example.com' --gearr-token XXXXXX\n```\n\nFeel free to customize the parameters based on your Radarr and Gearr setup.\n\n## Roadmap\n\nI'm currently not developing it more but if I want to code something I will:\n\n- Remove RabbitMQ in flavour of a gRPC API to communicate agents just with the server.\n- Replace repository by an ORM with Postgres and SQlite support.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpando85%2Fgearr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpando85%2Fgearr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpando85%2Fgearr/lists"}