{"id":13760948,"url":"https://github.com/zandaqo/ctfb","last_synced_at":"2025-04-05T07:32:24.491Z","repository":{"id":86163611,"uuid":"294481927","full_name":"zandaqo/ctfb","owner":"zandaqo","description":"A command-line tool to simplify combining and/or encoding audiobooks with chapters.","archived":false,"fork":false,"pushed_at":"2023-06-25T13:38:53.000Z","size":28,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T00:10:02.086Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zandaqo.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-10T17:49:19.000Z","updated_at":"2024-11-13T07:01:11.000Z","dependencies_parsed_at":"2024-08-03T13:17:46.765Z","dependency_job_id":null,"html_url":"https://github.com/zandaqo/ctfb","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"2269d34169382b7eb13a434452e223c14a0ca1e0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zandaqo%2Fctfb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zandaqo%2Fctfb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zandaqo%2Fctfb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zandaqo%2Fctfb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zandaqo","download_url":"https://codeload.github.com/zandaqo/ctfb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247305879,"owners_count":20917201,"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-08-03T13:01:29.016Z","updated_at":"2025-04-05T07:32:19.472Z","avatar_url":"https://github.com/zandaqo.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# CTFB\n\nA command-line tool to simplify combining and/or encoding audiobooks with\nchapters.\n\nCTFB will collect all files in the working directory that match given patterns,\ncreate a metadata file treating the files as chapters, and encode them into a\nsingle file with added chapter markers. If input files have chapter marks those\nwill be added to the chapters of the resulting file. In interactive mode, it\noffers to manually edit the generated metadata file before creating the final\naudio file in case the user wants to change, say, generated chapter markers.\nUnder the hood, it uses ffmpeg for encoding, hence, it supports a wide variety\nof audio formats as input and output.\n\nCTFB stands for whatever the user wants, for example, Commingle Thine Fabulous\nBook.\n\n## Installation\n\nCTFB uses [ffmpeg](https://ffmpeg.org/), so make sure it's installed. Install\nCTFB using NPM:\n\n```bash\nnpm i ctfb -g\n```\n\n## Usage\n\nBy default, CTFB will combine all the opus files in the working directory into\nan opus file named as the directory:\n\n```bash\n\u003e ls\nChapter 1.opus\nChapter 2.opus\nChapter 3.opus\nChapter 4.opus\nChapter 5.opus\n\n\u003e ctfb\n5 input files found.\nTotal duration: 00:19:05.234\nProgress: 100.000%\nTime Elapsed: 00:00:07.904\n```\n\nEach file will be treated as a chapter (or multiple chapters if they contain\nchapter marks) and the resulting file will have chapter marks at the beginning\ntime of each original file named as the file sans the extension.\n\nYou can specify title, input patterns, output file name (with extension),\nbitrate:\n\n```bash\n\u003e ctfb -t \"Fabulous Title\" -p \"*.wma\" -p \"*.mp3\" -b 32k -o \"fabulous.mp3\"\n```\n\nThis will combine all `.wma` and `.mp3` files into `fabulous.mp3` with a bitrate\nof 32k.\n\nIf bitrate parameter is not supplied, CTFB will attempt to combine files without\nre-encoding audio:\n\n````bash\n\u003e ctfb -p \"*.ogg\" -o \"out.ogg\"\n```\n\nYou can also use the interactive mode to enter the missing options manually \nand, more usefully, stop the processing before the final phase to manually edit the metadata file:\n```bash\n\u003e ctfb -b 32k -i\nTitle: Fabulous Title\nInput Pattern: *.mp3\nOutput File: abc.opus\n5 input files found.\nTotal duration: 00:19:05.234\nPress [m] to open the generated metadata file.\nPress any other button to start creating the book.\n````\n\n### Adding chapters from Youtube timestamps\n\nIt might so happen that you want to turn a youtube video with timestamps into an\naudiobook with chapters at the same timestamps. There is an excellent tool for\ndownloading the said videos:\n[youtube-dl](https://github.com/ytdl-org/youtube-dl/). As of now, it doesn't\nembed the timestamps into downloaded files, however, you can get the timestamps\nwritten into a separate json file using `--write-info-json` parameter:\n\n```bash\n\u003e youtube-dl -f 251 https://www.youtube.com/watch?v=krB0enBeSiE --write-info-json\n[youtube] krB0enBeSiE: Downloading webpage\n[info] Writing video description metadata as JSON to: Brendan Eich - JavaScript, Firefox, Mozilla, and Brave _ Lex Fridman Podcast #160-krB0enBeSiE.info.json\n[download] Destination: Brendan Eich - JavaScript, Firefox, Mozilla, and Brave _ Lex Fridman Podcast #160-krB0enBeSiE.webm\n...\n```\n\nThen you can re-encode and/or embed the chapters using CTFB and `-yt` parameter,\ne.g.:\n\n```bash\n\u003e ctfb -p \"*.webm\" -yt -b 32k -o 'podcast.opus'\n```\n\nIn this case, CTFB will look for all webm files and their respective json files\nwith chapter info, combine them embedding the chapter info into a single opus\nfile with bitrate of 32k.\n\n## Options\n\n| Option | Default    | Description                                                   |\n| ------ | ---------- | ------------------------------------------------------------- |\n| -t     | (cwd)      | The title of the final file.                                  |\n| -p     | *.mp3      | glob name patterns to look for as the input.                  |\n| -o     | (cwd).opus | Output file name with extension.                              |\n| -b     | 64k        | Bitrate of the final file.                                    |\n| -i     | -          | Enables the interactive mode.                                 |\n| -yt    | -          | Looks for chapters in .info.json files created by youtube-dl. |\n\n## License\n\nMIT @ Maga D. Zandaqo\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzandaqo%2Fctfb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzandaqo%2Fctfb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzandaqo%2Fctfb/lists"}