{"_id":"@daisy/books-to-videos","_rev":"7-aa586e6608cd096679f48572160ccc5d","time":{"0.1.0":"2021-07-21T20:28:34.834Z","0.1.1":"2021-07-21T20:28:34.834Z","0.1.2-alpha":"2021-07-21T20:28:34.834Z","0.1.3-alpha":"2021-07-21T20:28:34.834Z","created":"2021-07-22T20:50:51.731Z","0.1.5-alpha":"2021-07-22T20:50:52.021Z","modified":"2022-04-05T02:36:03.258Z","0.1.5-beta":"2021-09-16T23:44:38.663Z"},"name":"@daisy/books-to-videos","dist-tags":{"latest":"0.1.5-beta"},"versions":{"0.1.5-alpha":{"name":"@daisy/books-to-videos","version":"0.1.5-alpha","description":"Transform a synchronized text and audio book into a video presentation","engines":{"node":">=15.5.0","npm":">=7.3.0"},"keywords":["accessibility","DAISY","video","ebook"],"author":{"name":"DAISY developers","url":"http://www.daisy.org/"},"repository":{"type":"git","url":"git+https://github.com/daisy/books-to-videos.git"},"bugs":{"url":"https://github.com/daisy/books-to-videos/issues"},"license":"MIT","bin":{"books-to-videos":"build/src/cli/index.js"},"type":"module","scripts":{"build":"npm run clean && npm run compile && npm run copy-presets","clean":"rimraf -rf ./build","compile":"tsc","start":"node build/src/cli/index.js","copy-presets":"ncp src/cli/settings build/src/cli/settings && ncp test/resources build/test/resources","test":"npm run build && mocha --env dotenv_config_path=test/.env --require dotenv/config build/test/**/*.js"},"compilerOptions":{"types":["node","jsdom"]},"dependencies":{"@ffmpeg-installer/ffmpeg":"^1.0.20","@ffprobe-installer/ffprobe":"^1.1.0","chardet":"^1.3.0","commander":"^7.2.0","dayjs":"^1.10.4","dotenv":"^10.0.0","filenamify":"^4.2.0","fluent-ffmpeg":"^2.1.2","fs-extra":"^9.1.0","get-urls":"^10.0.0","iconv-lite":"^0.4.24","logform":"^2.2.0","mime-types":"^2.1.30","nanoid":"^3.1.22","puppeteer":"^8.0.0","remove":"^0.1.5","tmp":"^0.2.1","vtt-creator":"^1.1.1","winston":"^3.3.3","xmldom":"^0.6.0","xpath":"^0.0.32"},"devDependencies":{"@types/chai":"^4.2.21","@types/commander":"^2.12.2","@types/jsdom":"^16.2.10","@types/mocha":"^8.2.3","@types/node":"^14.14.41","@types/xmldom":"^0.1.30","chai":"^4.3.4","mocha":"^9.0.2","ncp":"^2.0.0","typescript":"^4.2.4"},"gitHead":"9c2845bbce6c00b288f152fa02da5ff236b87239","homepage":"https://github.com/daisy/books-to-videos#readme","_id":"@daisy/books-to-videos@0.1.5-alpha","_nodeVersion":"15.5.1","_npmVersion":"7.3.0","dist":{"integrity":"sha512-tCvMqzQJt8Rt8TWX5QCceChOn/SeFRfllRy52b5/EqgWY+mQKfe0+qD0N10jBT6LGvCU7v8YfPD2NET0LIbhbg==","shasum":"cbdcaa67d8dd02bbfa244408952d766f3ae138a7","tarball":"https://registry.npmjs.org/@daisy/books-to-videos/-/books-to-videos-0.1.5-alpha.tgz","fileCount":125,"unpackedSize":763058,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+dosCRA9TVsSAnZWagAAt3IQAIhlQB+ouFjclWx9aQRc\nqZT7E/5dEWeQ3Kb2OjPTpsH51XsERvG9CboaYO+ISnZ0lXys0kfLGJhjN2zO\nO0unDgXdJa2HO93ufSoS0FlabG8g9Bub8ycKUky3YjyJmx2tD0RIe7Hg8sXg\nEteoTsFnyR8MoHBbe2uF9c55iuhh7s2Sb99FTn+N79wa2XXnB7d0Uiyvp5fs\n97UlHq/1ZzJ4LR9IK+c1boV/xt73Dnyow9bu6WTzUY136n3LUyP2zQoYocgc\nxgCIBjmyIJYkalw4agkGblThdadq2HtsvRvm+OMfoqt8TwShzK6Uj69Chxl/\n9hRo5Tg4QyUEE6aM2mj4MewcDadCWdfT6Ar5OFruqtbjTwKL5zAqF3iPWoOl\nESDVZ7FmXOi4HIRhZCOC+ZGB083T1b79XTzR6ILlvwveABSLVN68nP/uPn6X\nO9xLhQxztGjcRtvpVGJGzUkqL1UzlGZAckFWFAgmkPLaO3B0kScI2FMUMxME\ni50HOwKurNab0sCnrHPNirrGhS3CS1zbDlX3fXH8sOKqoqpvtFiwNe58+3s3\nW2GGHasCqioqFExjusnEm363Oj2uotglG0+KMW0lig4ALh+/4x59WHqQzkds\nRs1x9Qw0aQy/2vRe3vj8vMH40APuapO6C03Sao5uB0KXobpRoeWvZyW4epVE\n871i\r\n=dJuW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLTrkILchT4JqCt2tDxy4lvRXSdb2OWNEAjYPjy3kTRAiBgVC+da8Cq+dxcq/ObHXoarD93j0ugO2ff4Pm6b+Up6w=="}]},"_npmUser":{"name":"marisademeglio","email":"marisa.demeglio@gmail.com"},"directories":{},"maintainers":[{"name":"rdeltour","email":"rdeltour@gmail.com"},{"name":"danielweck","email":"daniel.weck@gmail.com"},{"name":"marisademeglio","email":"marisa.demeglio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/books-to-videos_0.1.5-alpha_1626987051784_0.5458222492241382"},"_hasShrinkwrap":false},"0.1.5-beta":{"name":"@daisy/books-to-videos","version":"0.1.5-beta","description":"Transform a synchronized text and audio book into a video presentation","engines":{"node":">=15.5.0","npm":">=7.3.0"},"keywords":["accessibility","DAISY","video","ebook"],"author":{"name":"DAISY developers","url":"http://www.daisy.org/"},"repository":{"type":"git","url":"git+https://github.com/daisy/books-to-videos.git"},"bugs":{"url":"https://github.com/daisy/books-to-videos/issues"},"license":"MIT","bin":{"books-to-videos":"build/src/cli/index.js"},"type":"module","scripts":{"build":"npm run clean && npm run compile && npm run copy-presets","clean":"rimraf -rf ./build","compile":"tsc","start":"node build/src/cli/index.js","copy-presets":"ncp src/cli/settings build/src/cli/settings && ncp test/resources build/test/resources","test":"npm run build && mocha --env dotenv_config_path=test/.env --require dotenv/config build/test/**/*.js"},"compilerOptions":{"types":["node","jsdom"]},"dependencies":{"@ffmpeg-installer/ffmpeg":"^1.0.20","@ffprobe-installer/ffprobe":"^1.1.0","chardet":"^1.3.0","commander":"^7.2.0","dayjs":"^1.10.4","dotenv":"^10.0.0","filenamify":"^4.2.0","fluent-ffmpeg":"^2.1.2","fs-extra":"^9.1.0","get-urls":"^10.0.0","iconv-lite":"^0.4.24","logform":"^2.2.0","mime-types":"^2.1.30","nanoid":"^3.1.22","puppeteer":"^8.0.0","remove":"^0.1.5","tmp":"^0.2.1","vtt-creator":"^1.1.1","winston":"^3.3.3","xmldom":"^0.6.0","xpath":"^0.0.32"},"devDependencies":{"@types/chai":"^4.2.21","@types/commander":"^2.12.2","@types/jsdom":"^16.2.10","@types/mocha":"^8.2.3","@types/node":"^14.14.41","@types/xmldom":"^0.1.30","chai":"^4.3.4","mocha":"^9.0.2","ncp":"^2.0.0","typescript":"^4.2.4"},"gitHead":"6cfea3ff5b892fe0b21fe07e3cd84daa3a193fe1","homepage":"https://github.com/daisy/books-to-videos#readme","_id":"@daisy/books-to-videos@0.1.5-beta","_nodeVersion":"15.5.1","_npmVersion":"7.3.0","dist":{"integrity":"sha512-LgJ7V9zc7GUAXj6mS7e+whaU0gQrMnO2J3xNymikIkGSa0B9Dby5i84rQfVS3fME33StkmF2oSREz9HQT+Kutw==","shasum":"1304b33d414989062030e6e222934de1b9c5231f","tarball":"https://registry.npmjs.org/@daisy/books-to-videos/-/books-to-videos-0.1.5-beta.tgz","fileCount":125,"unpackedSize":765926,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhQ9bmCRA9TVsSAnZWagAAcnsQAI4UxGcc58I1WcNsW8qM\nzhviQQD2qG3z2QRxV9MkSxn8NZJ/4v4sPdLh99wZetyUSXTfAoZkdX9DBgKQ\nbw9zhJyK2YtVA9trg/2HK8Ufkio1JhEFRqsq9L3UDy0QROZn72i6Vnos9yy7\n7WHJaPCnN+0G6vrdmG0vhdHbqbjwDmGAik/kWC6YV+LoTQdeNeVjAiwLS3j+\nVHY2ybhmH97Cy/wN8qKt5iZssNBgit81AdfOq69UePT1tKL4GAWauRSY2sZ9\nBn5JGkS46aYkap+qd0cUAddrTpRcVP31R5LCqBMJtOiY9bofTB3Z9xKsK7u+\n8iIUQ/keSjXWHHZQS4I8DlDElWuzEq193QgO7MbPKvBByLDEV/Vu6bTJSr3s\nb7yb2zbFLMxqqPXJuHQ1ILriX67LRxkMydzFIgnrR4INhvJmweGShNzUn+vO\nD4viFDDN1Uu3MBMjgbJbEuLGWwXd/tOJ61r/sQ0wC+9BAVPoMGvBOxlhcLca\nZsTdDqYQaYeDLoVz0YnqieMBAwpdqHyul6QPA0nHET4MYcw36FvUOR/CmA9/\nRkdlwP2VZh7SuHdiQElhNX+IQOflq2L0D4OlDcHii+nmZ6x0dLX7Hcj3UwDn\nQbbI1G8kfuA982STAov+X0vv74efv3/dotTm1noCKugjlu5EiGFzIYSLVhwa\nnQA0\r\n=DaTR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiKuI4qeNWoirkoO0pY44+pEc7TJ2tl0gwy+hasObK0AiEA3s77VLdCrgkLO/DHkhioWBNn5sJE1r3QZlv7kEJzxwY="}]},"_npmUser":{"name":"marisademeglio","email":"marisa.demeglio@gmail.com"},"directories":{},"maintainers":[{"name":"rdeltour","email":"rdeltour@gmail.com"},{"name":"danielweck","email":"daniel.weck@gmail.com"},{"name":"marisademeglio","email":"marisa.demeglio@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/books-to-videos_0.1.5-beta_1631835878433_0.21916447603870814"},"_hasShrinkwrap":false}},"maintainers":[{"name":"rdeltour","email":"rdeltour@gmail.com"},{"name":"danielweck","email":"daniel.weck@gmail.com"},{"name":"marisademeglio","email":"marisa.demeglio@gmail.com"}],"description":"Transform a synchronized text and audio book into a video presentation","homepage":"https://github.com/daisy/books-to-videos#readme","keywords":["accessibility","DAISY","video","ebook"],"repository":{"type":"git","url":"git+https://github.com/daisy/books-to-videos.git"},"author":{"name":"DAISY developers","url":"http://www.daisy.org/"},"bugs":{"url":"https://github.com/daisy/books-to-videos/issues"},"license":"MIT","readme":"# Books to Videos\n[![Version](https://img.shields.io/npm/v/@daisy/books-to-videos.svg)](https://www.npmjs.com/package/@daisy/books-to-videos)\n[![Build Status](https://travis-ci.com/daisy/books-to-videos.svg?branch=main)](https://travis-ci.com/daisy/books-to-videos)\n[![Downloads](https://img.shields.io/npm/dm/@daisy/books-to-videos.svg)](https://www.npmjs.com/package/@daisy/books-to-videos)  \n[![Open Bugs](https://img.shields.io/github/issues-raw/daisy/books-to-videos/bug.svg)](https://github.com/daisy/books-to-videos/issues)\n[![License](https://img.shields.io/npm/l/@daisy/books-to-videos.svg)](LICENSE.md)\n\nConvert a synchronized text/audio book to a video displaying text and audio.\n\nCurrently supports DAISY 2.02 to MP4 video with CSS customization.\n\n## Installation\n\nFirst, install [nodejs](https://nodejs.org/en/download/current/), version 15.x or higher.\n\nThen from the command prompt, install the `books-to-videos` package:\n\n```\nnpm i -g @daisy/books-to-videos\n```\n\nTo see if it was installed successfully, test it out with this command:\n\n```\nbooks-to-videos --help\n```\n\nIf it worked, a short description should appear, along with a list of available commands.\n\n## Usage\n\nThis command:\n\n```\nbooks-to-videos convert /path/to/ncc.html /path/to/outputDirectory\n```\n\nWill create these files in `outputDirectory`:\n\n* Video file (MP4) of the DAISY 2.02 book\n* Video captions (VTT)\n* HTML file with the video and captions embedded in it\n* Log file of the conversion process\n\nThere are many ways to customize the output. Read on to learn more.\n\n## Video style\n\nThe text shown in the video can be customized by creating a stylesheet in CSS. In the stylesheet itself, use the classes `booksToVideos-container` for the whole video \"container\" and `booksToVideos-text` for the text portion. E.g.\n\n```\n.booksToVideos-container {    \n    width: 2000px;\n    height: 2000px;\n    background-color: black;\n}\n.booksToVideos-text {\n    font-family: Optima;\n    font-weight: bold;\n    color: lightblue;\n    line-height: 1.6;\n}\n\n```\n\nYou can pass the stylesheet to use in on the command line or specify it in the settings file.\n\nIf you pass in a custom stylesheet, either via `--stylesheet` or via custom settings, it will be used *in addition to* the default stylesheet as well as any presets that you're using. \n\n## Command line options\n\nSome settings can be configured via the command line. They are:\n\n* `-c, --chapters`: List of numbers, e.g. `--chapters 1 2 3`. Use this option to [convert part of a book](#convert-part-of-a-book) \n* `-d, --debug`: Run in [debug mode](#debugging)\n* `-e, --encoding`: Force a character [encoding](#set-encoding)\n* `-f, --fontsizePx <number>`: Value in pixels of the desired font size\n* `-n, --numPreviewSlides <number>`: Number of preview slides to generate, if in preview mode\n* `-r, --preset <file>`: Preset file (JSON). See (presets)[#presets]\n* `-p, --previewMode`: Only generate still images as a preview of the final output\n* `-s, --settings`: Custom settings file. E.g. `--settings my-settings.json` \n* `-t, --stylesheet <file>`: CSS file used for the [video style](#video-style). E.g. `--stylesheet my-style.css`\n* `-v, --verbose`: Turn verbose output on.\n* `-z, --vttSettings`: Specify [caption settings](#caption-settings)\n* `-h, --help`: Show help\n\nSettings on the command line override settings in a file.\n\n## Settings file\n\nAll the settings can be set via a file (JSON format). They are:\n\n| Option | Allowed values | Description |\n|--------|----------------|-------------|\n| __autosizeFont__ | `true`/`false` | Automatically determine the largest possible font size to use |\n| __chapters__ | An array e.g. `[1, 2, 3]` | If you don't want to convert the entire book, you may [convert part of a book](#convert-part-of-a-book) by specifying which chapters to include. If this value is empty (_`[]`_), the video will be created from the whole book.\n| __debug__ | |Run in [debug mode](#debugging)|\n| __encoding__| String | Specify an encoding for the DAISY book. Useful for solving encoding issues. | \n| __includePageNumbers__ | `true`/`false` | Whether video output should include page numbers. \n| __fontsizePx__ | Number of pixels | Force the fontsize to this value. If present, automatically overrides `autosizeFont`; therefore, this value is not present by default |\n| __maxHeight__ | Number of pixels | Maximum Chromium viewport height. There's no need to change this option. Edit the CSS for the `booksToVideos-container` class to change the video dimensions.\n| __maxWidth__ | Number of pixels | Maximum Chromium viewport width. There's no need to change this option. Edit the CSS for the `booksToVideos-container` class to change the video dimensions.\n| __numPreviewSlides__ | Number of slides, or `-1` | How many slides to create when running in `previewMode`. To create all possible slides, set this option to `-1`.\n| __previewMode__ | `true`/`false` | Create an HTML page with a list of slides instead of creating a video. Good for testing out styles; faster than making a video.\n| __quiet__ | `true`/`false` | Don't output anything on the command line\n| __reduceFontsizeBy__ | `number` | Reduce the autosized fontsize by this percent, e.g. `10` for 10 percent\n| __stylesheet__ | Filename | CSS file used for the [video style](#video-style)\n| __verbose__ | `true`/`false` | Include extra information in the command line output\n| __vttSettings__ | String | Specify [caption settings](#caption-settings)\n\n### Default settings \n\n```\n{\n    \"autosizeFont\": true,\n    \"chapters\": [],\n    \"debug\": false,\n    \"includePageNumbers\": false,\n    \"maxWidth\": 4000,\n    \"maxHeight\": 4000,\n    \"numPreviewSlides\": -1,\n    \"previewMode\": false,\n    \"quiet\": false,\n    \"stylesheet\": \"default.css\",\n    \"verbose\": true,\n    \"vttSettings\": \"\"\n}\n```\n### Presets\n\nIn addition to the default settings, there are 3 presets that can be used. They are:\n\n* `arabic`\n* `japanese`\n* `japanese-vertical`\n\nThe presets have specific overrides to better accommodate these scripts, such as for fonts and alignments. \n\nUse a preset on the command line:\n\n```\nbooks-to-videos convert /path/to/ncc.html /path/to/outputDirectory --preset arabic\n```\n\n### Custom settings file\n\nCustomize any settings by creating a custom file, e.g. \n`my-settings.json`:\n```\n{\n    \"stylesheet\": \"vertical.css\",\n    \"vttSettings\": \"align:middle position:60% vertical:rl\"\n}\n```\n\nIt does not have to include entries for every setting, just the ones you want to customize.\n\nThen pass the custom file on the command line:\n```\nbooks-to-videos convert /path/to/ncc.html /path/to/outputDirectory --settings /path/to/my-settings.json\n```\n\nIt is also possible to use a preset and a custom settings file. In the case that the same option is specified in more than one place, the value in the custom settings file will be what is used.\n\n## Tips\n\n### Convert part of a book\n\nIf you are just converting part of a book, you can use the numbers to say which chapters you want to convert:\n\n```\nbooks-to-videos convert /path/to/book/ncc.html /path/to/outputDirectory --chapters 2 3\n```\n\nTo get the chapter numbers, use the `list-chapters` command:\n\n```\nbooks-to-videos list-chapters /path/to/ncc.html\n\n1. First chapter\n2. Second chapter\n3. Third chapter\n\n```\n\nNote that when processing selected chapters intead of the whole book, the fontsize will be optimized for those chapters. It may be different when the whole book is processed.\n\n### Encoding\n\nWhile Books-to-Videos will attempt to detect the encoding, in some cases if it is not reliably found, you may specify it with the `--encoding` option. One encoding may be specified for an entire publication.\n\n### Custom fonts\n\nYou may specify your own font in a custom CSS file:\n\n```\n@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP&display=swap');\n\n.booksToVideos-text {\n    font-family: 'Noto Sans JP', sans-serif;\n}\n```\n\nBe sure to use the `@import` syntax rather than referring to a local file on disk via `@font-face`. Local font files are not supported.\n\nAlso note that the `@import` statement must be at the top of the CSS file, as is the standard requirement.\n\n### Font size \n\nThe video will use just one font size for all its contents. The font size is determined based on your settings.\n\nBy default, `autosizeFont` is enabled in the settings JSON file. To override this, set the font size you would like instead on the command line with the `fontsizePx` option. E.g. \n\n```\nbooks-to-videos convert /path/to/ncc.html outDirectory --fontsizePx 25\n```\n\nWould apply a fontsize of `25px` to the video output.\n\nTwo other ways to accomplish the same result are:\n\n### Use CSS\n1. Create a custom configuration file with `autosizeFont` set to `false`\n2. Create a custom CSS file and include your desired fontsize there, under the class selector `.booksToVideos-text`\n\n### `fontsizePx` in settings file\n\n1. Create a custom settings JSON file with `fontsizePx` set to the value you want.\n2. Specify this custom file on the command line with the `--settings` parameter\n\n### Caption settings\n\nBooks-to-Videos creates a VTT captions file to accompany the video. The option `--vttSettings` contains settings to apply to every caption. This can be used to control the position of captions and to create vertical captions. Note that there is just one setting and it will apply to all captions. Finer-grained control for per-caption settings may be introduced in future versions if there is interest.\n\nE.g. \n\n```\nbooks-to-videos convert /path/to/ncc.html /path/to/outputDirectory --vttSettings \"align:middle position:60% vertical:rl\"\n```\n\nResults in this type of captions file:\n```\nWEBVTT\n\n1\n00:00:00.000 --> 00:00:02.666 align:middle position:60% vertical:rl\nごん狐\n\n2\n00:00:02.666 --> 00:00:04.713 align:middle position:60% vertical:rl\n新美南吉\n\n3\n00:00:04.713 --> 00:00:06.343 align:middle position:60% vertical:rl\n一\n\n...\n```\n\n### URLs\n\nSometimes a phrase contains a very long URL and we may wish to apply custom word wrapping rules to that type of text. Books-to-videos inserts a class \"url\" into the text containing URLs so that it may be styled differently. E.g. \n\n```\n<span id=\"xmri_0034\">https://extranet.who.int/kobe<span class=\"tex\">_</span>centre/ja/news/COVID19<span class=\"tex\">_</span>specialpage<span class=\"tex\">_</span>public</span>\n```\n\nbecomes\n\n```\n<span id=\"xmri_0034\" class=\"url\">https://extranet.who.int/kobe<span class=\"tex\">_</span>centre/ja/news/COVID19<span class=\"tex\">_</span>specialpage<span class=\"tex\">_</span>public</span>\n```\n\nand then in the stylesheet, we have this default:\n\n```\n.url {\n    word-break: break-all;\n}\n```\n\n\n### Debugging\n\nUse the `--debug` option to collect more details about program execution. The `--debug` option will:\n\n* Save a JSON model of the book to disk\n* Copy the following temp files to the output directory, in a `debug` subdirectory:\n    * Images of each slide\n    * Video clips of each slide\n* Include an HTML page for each slide, in a `debug/html` subdirectory. This is useful for testing different CSS approaches.\n\nNote that the `--debug` option will show Chromium running and may ask you to allow incoming network connections. \n\nAlso note that the `--debug` option may not provide the best images, so it's only recommended to use for troubleshooting, not for the final result.\n\n### Development\n\nSee the [development notes](https://github.com/daisy/books-to-videos/wiki/Development-notes).\n","readmeFilename":"README.md"}