{"id":21141182,"url":"https://github.com/aaal-dev/folder2mkv","last_synced_at":"2026-04-28T19:03:20.127Z","repository":{"id":190809366,"uuid":"303991562","full_name":"aaal-dev/folder2mkv","owner":"aaal-dev","description":"Bash script for batch merging content to mkv files in folder by one mkvtoolnix option file","archived":false,"fork":false,"pushed_at":"2020-10-14T19:04:21.000Z","size":19,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-31T08:21:25.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaal-dev.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}},"created_at":"2020-10-14T11:18:02.000Z","updated_at":"2022-05-16T05:09:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"f5a01396-7357-4816-8e0b-a00bfa6bfc27","html_url":"https://github.com/aaal-dev/folder2mkv","commit_stats":null,"previous_names":["aaal-dev/folder2mkv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aaal-dev/folder2mkv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaal-dev%2Ffolder2mkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaal-dev%2Ffolder2mkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaal-dev%2Ffolder2mkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaal-dev%2Ffolder2mkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaal-dev","download_url":"https://codeload.github.com/aaal-dev/folder2mkv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaal-dev%2Ffolder2mkv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32394479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-11-20T07:24:26.143Z","updated_at":"2026-04-28T19:03:20.100Z","avatar_url":"https://github.com/aaal-dev.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# folder2mkv\nBash script for batch merging content to mkv files in folder by only one MKVToolNix option file. The core feature is to take additional files in other folders with same names as input files to add them in result output file. Script also don't change any information about attachments if you need put same attachment to each output file. Optionaly it can use title information from [Kodi's local .nfo metadata files](https://kodi.wiki/view/NFO_files/TV_shows) if they had the same name as input video files and locate in the same folder with input video files. \n\n**Option file must be created in MKVToolNix. Script don't able to work without it.** (Go to `Multiplexer \u003e Create Option File`) \n\nScript use [mkvmerge](https://mkvtoolnix.download/doc/mkvmerge.html)\n\nPosible arguments:\n* `\u003cinputPath\u003e` - path to the directory with input video files.\n* `\u003cextention\u003e` -  video file extension (`mkv`, `mp4`, `avi`, etc.) that will be used to find files in `\u003cinputPath\u003e` (is `mkv` by default if not defined).\n* `\u003cscriptFile\u003e` - path to the MKVToolNix option file .\n* `\u003coutputPath\u003e` - path to the output directory for result mkv files (is the same directory as `\u003cinputPath\u003e` by default if not defined).\n\nUsage:                                                                  \n* `folder2mkv \u003cinputPath\u003e [\u003cextention\u003e] [\u003cscriptFile\u003e] [\u003coutputPath\u003e]` \\\nor\n* `folder2mkv [options]` \\\nor\n* `folder2mkv` (without any aguments for the secret mode) \n\nOptions:                                                                        \n* `-c, --cover [\u003ccoverFile\u003e]` - add custom cover picture to the result mkv files. One picture for all output files. Picture file must be `.jpg` or `.png` format. If `\u003ccoverPath\u003e` is not defined picture will be taken from `\u003cinputPath\u003e` folder with `seasonXX-poster.**g` or `cover.**g` or `poster.**g` filename.                      \n* `-e, --extension \u003cextension\u003e`                                                \n* `-i, --inputPath \u003cinputPath\u003e`                                                \n* `-o, --outputPath \u003coutputPath\u003e`                                               \n* `-s, --scriptFile \u003cscriptFile\u003e`                                               \n* `-t, --title` - add custom title to metadata of the result mkv file. Title line will be replaced with name of the input file. Custom title can be parsed from the kodi's .nfo infomation file that has the same name as input video file. If add `%title%` to any mkv track name (e.g. Video track) script also change it to same custom title  \n* `-h, --help` for help.                        \n                                                                                \nNOTE: Usage cases #1 and #2 can be mixed for your convenience. Only need to keep the order of the arguments of case #1 style.                              \nExample: `folder2mkv \u003cinputPath\u003e -ct \u003coutputPath\u003e`\n\nNOTE: `-c` and `-t` options can be mixed in `-ct` or `-tc`, but without any ~`\u003ccoverFile\u003e`~ string. \n                                                                            \n### How it's works\n\nScript will parse MKVToolNix option file into the string and will search for input files in `\u003cinputPath\u003e`folder with defined `\u003cextention\u003e`. If `--scriptFile` option is not defined, script will try to find `script.json` file in `\u003cinputPath\u003e` folder and will stop if can't find it. Script will make temporary folder in `\u003cinputPath\u003e` with name which stored in `tempFolderName` variable in script itself. By default the name is `mkvtmp`. You can change it whatever you want. Then if `--cover` option is defined script will copy cover picture in temporary folder for later use.  If `--title` option is defined, script will parse `.nfo` files for title or will use input file name for it. Then script will parse each MKVToolNix option string to change some information and to add some extra options for `mkvmerge`. After that it will execute result string. Result output file will move in `\u003coutputPath\u003e` or will replace input file in `\u003cinputPath\u003e` if `\u003coutputPath\u003e` id not defined.  \n\nExample of MKVToolNix option file\n```\n[\n  \"--ui-language\",\n  \"en_US\",\n  \"--output\",\n  \"/home/user/video/Wedding/Day 1/In Bride's house.mkv\",\n  \"--language\",\n  \"0:en\",\n  \"--track-name\",\n  \"0:%title%\",\n  \"--default-track\",\n  \"0:yes\",\n  \"--display-dimensions\",\n  \"0:1920x1080\",\n  \"--language\",\n  \"1:en\",\n  \"--track-name\",\n  \"1:Camera microphone\",\n  \"--default-track\",\n  \"1:yes\",\n  \"(\",\n  \"/home/user/Download/Wedding/Day 1/Uncle Comments/In Bride's house.mka\",\n  \")\",\n  \"--language\",\n  \"0:en\",\n  \"--track-name\",\n  \"0:Uncle Josh's Comments\",\n  \"(\",\n  \"/home/user/Download/Wedding/Day 1/Ricky's Music/In Bride's house.wav\",\n  \")\",\n  \"--language\",\n  \"0:en\",\n  \"--track-name\",\n  \"0:Ricky's Background Music\",\n  \"(\",\n  \"/home/user/Download/Wedding/Day 1/Subtitles for Grandma/In Bride's house.ass\",\n  \")\",\n  \"--track-order\",\n  \"0:0,0:1,1:0,2:0\"\n]\n```\nExample of output parsed string\n`/usr/bin/mkvmerge --ui-language 'en_US' --output '/home/user/video/Wedding/Day 1/In Bride's house.mkv' --language '0:en' --track-name '0:%title%' --default-track '0:yes' '--display-dimensions' '0:1920x1080' --language '1:en'` and etc.\n\n### Extra notes\nIt is my old script that I use sometimes. Version in this repository is refactored and can do nothing or break video files. So use it at your own risk. \n\nI don't use MKVToolNix settings file because is too difficult to parse it. \n\nI will accept any issues, but fix may take too long. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaal-dev%2Ffolder2mkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaal-dev%2Ffolder2mkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaal-dev%2Ffolder2mkv/lists"}