{"id":19655960,"url":"https://github.com/dislick/m-conv","last_synced_at":"2025-10-25T15:08:38.219Z","repository":{"id":49906781,"uuid":"145097142","full_name":"dislick/m-conv","owner":"dislick","description":"Watches a directory and converts media files according to defined tasks","archived":false,"fork":false,"pushed_at":"2021-06-08T12:29:11.000Z","size":472,"stargazers_count":7,"open_issues_count":2,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-09T15:13:36.486Z","etag":null,"topics":["converter","ffmpeg","imagemagick","media","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dislick.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":"2018-08-17T08:56:09.000Z","updated_at":"2024-09-14T21:05:12.000Z","dependencies_parsed_at":"2022-08-30T01:41:52.193Z","dependency_job_id":null,"html_url":"https://github.com/dislick/m-conv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dislick/m-conv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dislick%2Fm-conv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dislick%2Fm-conv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dislick%2Fm-conv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dislick%2Fm-conv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dislick","download_url":"https://codeload.github.com/dislick/m-conv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dislick%2Fm-conv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280973010,"owners_count":26422901,"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-10-25T02:00:06.499Z","response_time":81,"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":["converter","ffmpeg","imagemagick","media","nodejs"],"created_at":"2024-11-11T15:25:19.395Z","updated_at":"2025-10-25T15:08:38.201Z","avatar_url":"https://github.com/dislick.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# m-conv\n\nm-conv watches a directory and converts media files according to rules defined in a `m-conv-tasks.json` file. It's supposed to be used on a server where the users can copy their media files onto a network share and then receive their converted files in the output folder.\n\nIt allows the user to paste a whole directory tree and will keep that structure in the output directory to be as user-friendly as possible.\n\n## Demo\n\n![demo video](.github/mconvdemo.gif)\n\n## Example Task\n\nThe example task converts videos to 720p using `ffmpeg`.\n\n```javascript\n{\n  \"tasks\": [\n    {\n      \"group\": \"videos\",\n      \"command\": \"ffmpeg -i \\\"{{input}}\\\" -y {{flags}} \\\"{{output}}\\\"\",\n      \"matched_ext\": [\n        \"mp4\",\n        \"mpg\",\n        \"mpeg\",\n        \"wmv\",\n        \"flv\",\n        \"avi\",\n        \"mov\"\n      ],\n      \"jobs\": [\n        {\n          \"name\": \"720p_H264_medium\",\n          \"flags\": \"-vf scale=1280:-2 -c:v libx264 -crf 20\",\n          \"out_ext\": \"mp4\"\n        },\n        {\n          \"name\": \"720p_H264_high\",\n          \"flags\": \"-vf scale=1280:-2 -c:v libx264 -crf 15\",\n          \"out_ext\": \"mp4\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n### Keys\n\n#### `group`\n\nName of the group, must be unique among tasks.\n\n#### `command`\n\nTemplate string for the command that will be executed. You can use the following variables:\n\n- `{{input}}`: Absolute path to the input file, e.g. `/var/media/file 1.jpg`\n- `{{output}}`: Absolute path to the output file, e.g. `/var/media/out/file 1.jpg`\n- `{{flags}}`: Flags that are defined in each job\n\n**Careful:** Make sure to always escape input and output variables with quotation marks as demonstrated in the example task.\n\n#### `matched_ext`\n\nArray of file extensions that you want to execute this task on. Do not include a dot in front of the extension.\n\n#### `jobs`\n\nArray of jobs you want to execute for each file. The `name` of a job is going to be the name of the output directory. `out_ext` is the extension that will be added to the final output path in the template variable `{{output}}`.\n\n## Environment Variables\n\n- `CONVERT_WATCH_DIR`: Directory to watch, should be a relative path like `./share/input`\n- `CONVERT_OUT_DIR`: Directory for the output files, should be a relative path like `./share/output`\n\nBoth variables default to `./input` and `./output`.\n\n## Clearing Directories\n\nYou should setup a cronjob to empty the directories every now and then:\n\n```\n0 0 * * 0       rm -rf /var/mediaconverter/share/input/*\n0 0 * * 0       rm -rf /var/mediaconverter/share/output/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdislick%2Fm-conv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdislick%2Fm-conv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdislick%2Fm-conv/lists"}