Repository navigation
Film each scene with a camera that follows the narration - #32
Merged
Merged
Conversation
Before anything is drawn, explainroo now measures each element of a scene: where it is, how big it is and when it is on screen. From that it plans a camera for the scene. The camera opens on the picture and widens when something new would not fit. Something new that already fits needs no move. Now and then the camera moves in on what the voice talks about, and near the end of the scene it pulls back to show the whole picture. While a shot holds, cards and labels are never cut in half. Shots stay clear of the captions and of the buttons Shorts, TikTok and Reels put over the video. Highlighted code lines, terminal commands and the new s.focus() get close-ups when they are small in the shot. A scene that goes on with the picture of the scene before it keeps the camera where it was and fades in. The background moves a third as much as the camera, so it looks further away. s.camera() still takes over a scene's camera, and "camera": "still" in video.json turns the camera off. Entrances now move on a spring and lift their shadow while they land. Final renders add motion blur to frames where something moves. Each such frame is drawn six times over half a frame's time and averaged. Drafts, GIFs and transparent videos skip it, and "motionBlur": false turns it off. Large headlines in the clean, midnight and editorial looks get slightly tighter letter spacing. AGENTS.md and the README describe the camera.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Until now each scene was one fixed frame, and a small diagram often sat in a corner of an empty frame. This adds a camera that films each scene, plus spring entrances and motion blur.
The camera. Before anything is drawn, explainroo measures each element of a scene: where it is, how big it is and when it is on screen. The camera opens on the picture and widens when something new would not fit. Something new that already fits needs no move, so a line added to a chart does not make the camera zoom. Now and then the camera moves in on what the voice talks about. It does that only when the viewer gets at least 1.5 seconds to look, and when the zoom last changed five or more seconds ago. Near the end of the scene it pulls back to show the whole picture.
While a shot holds, cards and labels are never cut in half. Each one is fully in the shot or out of it. Shots stay clear of the captions and of the buttons Shorts, TikTok and Reels put over the video. Highlighted code lines, terminal commands and the new
s.focus()get close-ups when they are small in the shot. When a scene goes on with the picture of the scene before it, the camera stays where it was and the two scenes fade into each other.s.camera()still takes over a scene's camera, and"camera": "still"invideo.jsonturns the camera off.Motion. Entrances move on a spring and lift their shadow while they land. Final renders draw each moving frame six times over half a frame's time and average them, which gives motion blur. Drafts, GIFs and transparent videos skip it, and
"motionBlur": falseturns it off. Large headlines in the clean, midnight and editorial looks get slightly tighter letter spacing.Cost. Final renders take about two to three times as long, and the MP4 files are about twice as big. Drafts are as fast as before.
Testing.
npm testpasses (216 tests). New tests check that a held shot never cuts a card, that something new that fits causes no move, that the camera does not keep zooming in and out, that the measured size of drawings matches what Chrome draws, and that motion blur keeps clip frames intact. I rendered the DNS, intro, leap years and callbacks examples with this branch and with 0.3.0 and compared them side by side. All four passverify, with the narration understood 100%.