{"id":13877832,"url":"https://github.com/tjunttila/pdf2video","last_synced_at":"2025-07-16T13:32:45.658Z","repository":{"id":217000697,"uuid":"284488408","full_name":"tjunttila/pdf2video","owner":"tjunttila","description":"A tool for making videos from PDF presentations.","archived":false,"fork":false,"pushed_at":"2021-02-23T21:29:31.000Z","size":398,"stargazers_count":23,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-24T06:32:59.704Z","etag":null,"topics":["amazon-polly","ffmpeg","mp4-video","pdf","poppler","presentation","srt-subtitles","text-to-speech","video","webvtt-subtitles"],"latest_commit_sha":null,"homepage":"","language":"Python","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/tjunttila.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}},"created_at":"2020-08-02T15:27:00.000Z","updated_at":"2024-09-28T01:42:15.000Z","dependencies_parsed_at":"2024-01-14T03:51:51.970Z","dependency_job_id":"36f208b9-5d5a-4e93-956d-702ff522ea97","html_url":"https://github.com/tjunttila/pdf2video","commit_stats":null,"previous_names":["tjunttila/pdf2video"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/tjunttila/pdf2video","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjunttila%2Fpdf2video","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjunttila%2Fpdf2video/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjunttila%2Fpdf2video/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjunttila%2Fpdf2video/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tjunttila","download_url":"https://codeload.github.com/tjunttila/pdf2video/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tjunttila%2Fpdf2video/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265514205,"owners_count":23780237,"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":["amazon-polly","ffmpeg","mp4-video","pdf","poppler","presentation","srt-subtitles","text-to-speech","video","webvtt-subtitles"],"created_at":"2024-08-06T08:01:27.946Z","updated_at":"2025-07-16T13:32:45.289Z","avatar_url":"https://github.com/tjunttila.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Description\n\n`pdf2video` is a Python script that combines\n\n* (selected pages of) a [PDF](https://en.wikipedia.org/wiki/PDF) presentation, and\n* a text script\n\ninto a video narrated by the [Amazon Polly](https://aws.amazon.com/polly/) text-to-speech engine.\nIt can be used to generate, for instance, educational videos.\n\nPlease see this [sample video](https://users.aalto.fi/tjunttil/pdf2video.mp4),\nproduced with the tool, for a short introduction.\nObserve that some browsers don't show the subtitles embedded in MP4 videos,\nplease see this [sample video with WebVTT subtitles](https://users.aalto.fi/tjunttil/pdf2video.html) in such as case.\n\n# Requirements\n\nUsing `pdf2video` requires the following external tools and services:\n\n* [Python](https://www.python.org/) version 3.6 or later.\n* The `pdfinfo` and `pdftoppm` command line tools provided in the [poppler PDF rendering library](https://poppler.freedesktop.org/).\n  \n  In Ubuntu Linux, you can install these with `sudo apt get poppler-utils`.\n  \n  For macOs, they are available at least from [Homebrew](https://brew.sh/) with `brew install poppler`.\n* The `ffmpeg` command line tool from the [`FFmpeg`](https://ffmpeg.org/) framework.\n  \n  In Ubuntu Linux, you can install it with `sudo apt get ffmpeg`.\n  \n  For macOs, it is available at least from [Homebrew](https://brew.sh/) with `brew install ffmpeg`.\n* Access to [Amazon Web Services](https://aws.amazon.com/).\n* The [AWS Command Line Interface](https://aws.amazon.com/cli/) configured with a [profile](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html) that can access the Polly service. To use the [neural voices](https://docs.aws.amazon.com/polly/latest/dg/ntts-voices-main.html) (recommended for the best quality), remember to select [a region in which they are supported](https://docs.aws.amazon.com/polly/latest/dg/NTTS-main.html).\n\n# Installation\n\nOne can use `pip` to install `pdf2video` directly from GitHub:\n```\npython3 -m pip install git+https://github.com/tjunttila/pdf2video.git\n```\nSee the [PyPA Installing Packages tutorial](https://packaging.python.org/tutorials/installing-packages/) for information on installing Python packages and on Python virtual environments.\n\n# Usage\n\nIn the simplest case,\n```\npdf2video presentation.pdf script.txt video.mp4\n```\nconverts the PDF file  `presentation.pdf` and\nthe UTF-8 encoded script file `script.txt`\ninto the video `video.mp4` narrated by the default voice (Amazon Polly standard voice Joanna in the current version).\nThe video includes SRT subtitles that can be displayed by most video players.\nIn addition, for HTML use, [WebVTT subtitles](https://www.w3schools.com/tags/tag_track.asp) are produced in a separate file as well.\n\nThe selected PDF pages as well as the narration voice can be changed easily.\nFor instance, the [sample video](https://users.aalto.fi/tjunttil/pdf2video.mp4) was produced with the command\n```\npdf2video sample.pdf sample.txt --pages \"1,2,4-6\" --voice Matthew --neural --conversational sample.mp4\n```\nAll the options can be printed with `pdf2video --help`.\n\nThe script file is formatted as follows.\nThe script for each presentation page starts with a line `#page [name]` and\nthe following text then contains the script. The optional `[name]` parameter, that can be used in the `--only` option of the tool, is a string of ascii letters and underscores, possibly followed by a non-negative number. For instance `defs` and `example_3` are valid names.\n\nA line starting with `%` is a comment and thus ignored.\n\nIn the script text, one can use the following modifiers:\n\n* `*text*` to read `text` in an emphasized style,\n* `@xyz@` to spell `xyz` as characters,\n* `#slow/text/` to read `text` in a slower rate,\n* `#high/text/` to use higher pitch for `text`,\n* `#low/text/` to use lower pitch for `text`,\n* `#n`, where `n` is a positive integer, to have a pause of length of `n`*100ms,\n* `#ph/word/pronunciation/` spell the `word` with the [X-SAMPA](https://en.wikipedia.org/wiki/X-SAMPA) `pronunciation`, and\n* `#sub/text/subtitle/` to use `subtitle` as the subtitle instead of the spoken `text`.\n\nAbove, the `/` delimiter can be any other symbol not occurring in the \"arguments\" of the modifier.\nThis allows one to nest modifiers.\nFor instance,\n`#sub/big-#ph!Theta!Ti:.t@! of n/Θ(n)/`\nreads as \"big-theta of n\" but shows as `Θ(n)` in the subtitles.\n\nPlease see the file [sample.txt](sample.txt) file for examples.\n\n\n# Some good practices and hints\n\n* Converting a script with many pages to video can take some time. For developing and debugging the script text, it is recommended to name the script pages with `#page pagename`, and then use the `--only` option of the tool to convert only the page under development.\n* For pronunciations, one can find [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) pronunciations in many online dictionaries, and then convert them to X-SAMPA by using the table in the [X-SAMPA Wikipedia page](https://en.wikipedia.org/wiki/X-SAMPA).\n* Whenever possible, avoid using the `@xyz@` construct as it seems to change the pitch of the whole sentence.\n\n\n# License\n\nThe `pdf2video` tool is relased under the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjunttila%2Fpdf2video","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftjunttila%2Fpdf2video","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftjunttila%2Fpdf2video/lists"}