Skip to main content
Cookbook Content Presto Player

Add Chapters to a Video from Its Captions with Presto Player and AI

Chapter markers made from a video's captions, with titles you approve, saved on a Presto Player video.

Difficulty Beginner
Time ~10 min

Prerequisites

A site connected to WPVibe running a recent Presto Player (tested on 4.5.6, free) on WordPress 6.9 or newer, with an administrator account, and Enable AI access and Allow AI to make changes turned on in Presto Player, Settings, AI Abilities and MCP. The video's captions as WebVTT or SRT text (YouTube Studio can download them), or a list of times and titles.

The prompt
My WordPress site uses Presto Player. Add chapters to my video [video title] from these captions: [paste the captions as WebVTT or SRT text, or a list of times and chapter titles].

1. Run discover_abilities with category presto-player. If presto-player/list-videos, presto-player/chapters-list, presto-player/chapters-generate-from-captions-deterministic and presto-player/chapters-save are not there: if no presto-player abilities show at all, tell me to install or update the free Presto Player plugin (its AI abilities need WordPress 6.9 or newer) and to turn on Enable AI access in Presto Player, Settings, AI Abilities and MCP; if only the read abilities show (such as presto-player/list-videos), tell me to turn on Allow AI to make changes there too. Then stop.
2. Run presto-player/list-videos with search set to words from the video's title and per_page 50. If several match, show them with title, type and src and ask which one. If none match, run it again without search and show me the list. Note its video_id and post_id. If its post_id is 0 or its shortcode is empty, tell me the video has no Media Hub post, usually because it was placed directly on a page, so these abilities can't change it (edit it on that page instead), and stop.
3. If the video's shares_post_with is not empty, tell me other Media Hub videos use the same post, so saving could change the wrong video's chapters, and stop. Run presto-player/chapters-list with the video_id. Show me the chapters it has now, and tell me saving replaces all of them, so I should say which to keep.
4. Work out the video's length: its duration in list-videos, or, if that is 0, ask me (the time of the last caption is a lower bound). If I gave captions: if they are SRT, turn them into WebVTT (add a first line WEBVTT, drop the cue numbers, and write the times with a dot instead of a comma, such as 00:01:20.000). If they are about 5,000 characters or fewer, run presto-player/chapters-generate-from-captions-deterministic with vtt set to them (for a video under 10 minutes, set min_chapter_len 30). If they are longer, or that call fails, do not send them: WPVibe sends this ability's input in the web address, which has a length limit. Find the chapters yourself the same way instead: a new chapter where the captions pause for 8 seconds or more, with chapters at least 60 seconds apart (30 for a video under 10 minutes), the first at 0:00. Each title it returns is the words spoken there: rewrite each as a short chapter title of a few words that says what that part is about. If I gave a list of times and titles, use it as it is. The first chapter starts at 0:00. Times are minutes and seconds, such as 1:30, and minutes go past 59 for long videos (75:00). Presto does not check times against the video's length, so drop any chapter past the end. Show me the list with the chapters I keep from step 3, in time order, and wait for my yes or edits.
5. Run presto-player/chapters-save with the video_id and chapters set to the full list, each with time and title. Tell me viewers see the chapters as soon as they are saved on any published page that shows the video.
6. Run presto-player/chapters-list again and confirm each time and title reads back as approved. Give me the sentence to put the old chapters back, with the real values: Save these chapters on the Presto Player video VIDEO_ID with presto-player/chapters-save: OLD_CHAPTERS (an empty list if it had none).
Already connected?

Skip pasting the full prompt. Drop this into your AI on a site that already has WPVibe:

Run the “Add Chapters to a Video from Its Captions with Presto Player and AI” recipe from the WPVibe cookbook on my connected site.

A long video without chapters makes viewers scrub around for the part they came for, and many give up. Writing chapters by hand means watching the whole thing again with a notepad, noting times and naming each part.

Paste the video’s captions, or a list of times and titles. Presto Player, or the AI for long captions, finds where the talk pauses and proposes a chapter at each pause, and the AI turns the spoken words there into short, clear titles. You check the list, and only then is it saved on the video, where the chapters show as markers on the player.

Saving replaces every chapter the video already has, so the AI shows you the current ones first and keeps the ones you want. Presto doesn’t check chapter times against the video’s length, so the AI asks for it when it can’t tell. On a published page, viewers see the new chapters as soon as they are saved. To put a video on a page first, use this recipe.

Outcome

The video shows the chapters you approved on its player, and you have the sentence that puts the old ones back.