Sub topic 2
Timeline, clips, and the playhead
This chapter explains the working model behind every video editor: the timeline, the clips placed on it, and the playhead that you move through it. It assumes you can open a video file in an editor, run a command in a terminal, and tell a track from a file. You do not need earlier editing experience. The ideas here support the next chapters on finding mistakes and cutting them out.
The working model
A video editor does not change your recording while you work. It keeps a project, which is a small file of instructions that points at your source media. The project says which file to use, which part of it to show, and where to place that part in time. When you export, the editor follows those instructions and writes a new video.
Three objects make up the model:
- Source media is the original file, for example
lecture.mp4. The editor reads it and never rewrites it. - A clip is a reference to a range of a source file. It stores a file, an in point (where the clip starts inside the source) and an out point (where it ends).
- The timeline is the sequence of clips arranged against time. It is what your viewer will watch.
Because a clip is only a reference, trimming it is cheap and reversible. Dragging an edge changes a number, not the file.
Tracks and layers
The timeline is divided into horizontal tracks. A track holds clips one after another, and clips on one track cannot overlap.
- Video tracks are stacked. When two video clips cover the same moment, the upper track is shown on top. This is how overlays and zoomed versions of a slide work later.
- Audio tracks are mixed. Clips on several audio tracks play at the same time, so you can place narration on one track and music on another.
A typical screen lecture has one video track and one audio track. Most editors link the video and audio that came from the same file, so they move and cut together. Linked clips are the main protection against sync errors, which Chapter 5 covers in detail.
Time on the timeline
Time runs left to right. A ruler at the top shows it, usually as a timecode in the form HH:MM:SS:FF, where FF is the frame number inside the second. A frame is one still image. At 30 frames per second (fps), 00:01:12:15 means 1 minute, 12 seconds and 15 frames, which is 72.5 s.
Two consequences matter for accuracy:
- The frame is the smallest unit of video editing. You can cut between two frames but not inside one. At 30 fps the precision is about 33 ms.
- Audio is much finer than video. Audio at 48,000 samples per second can be cut at a far smaller step than a frame. Editors let you cut audio between frames, and this is useful when a word ends partway through a frame.
You can check the frame rate and duration of your source before you start:
ffprobe -v error -select_streams v:0 \
-show_entries stream=r_frame_rate,duration \
-of default=noprint_wrappers=1 lecture.mp4The output looks like r_frame_rate=30/1 and duration=1834.500000. Some screen recordings have a variable frame rate, which can make timecodes drift against the audio. If the value looks odd, such as r_frame_rate=90000/1, convert the file to a constant rate before editing.
The playhead
The playhead is the vertical line that marks the current position on the timeline. It does three jobs:
- It selects which frame appears in the preview window.
- It sets the position of the next edit. Most editors cut at the playhead when you press a split command (often
S,B, orCtrl+K). - It marks where pasted or inserted clips go.
You move the playhead by clicking the ruler, dragging it (scrubbing), or using the keyboard. Learn these actions, since they make precise editing far faster than using the mouse:
| Action | Typical shortcut |
|---|---|
| Play and pause | Space |
| Step one frame | Left and right arrows |
| Jump to the previous or next cut | Up and down arrows |
| Mark an in point | I |
| Mark an out point | O |
| Split at the playhead | S, B, or Ctrl+K (varies by editor) |
Shortcuts differ between editors, so check the keyboard map of yours.
Scrubbing is imprecise at a fully zoomed-out timeline. Zoom the timeline in, which is a view change only and does not affect the video, until single frames are wide enough to hit. Do this before every precise cut.
Selection, snapping, and editing modes
Three settings change what a cut or drag does.
Selection. Editing commands act on the selected clips. If you split with only the video selected, the audio stays whole and the two fall out of step. Check what is selected before every split.
Snapping. With snapping on, the playhead and dragged clip edges jump to nearby cut points and markers. It keeps clips flush so that no gaps appear. Turn it off briefly when you need to place something a few frames away from a neighbor.
Delete mode. Deleting a clip has two common forms:
- A plain delete removes the clip and leaves a gap of empty time.
- A ripple delete removes the clip and shifts everything after it left to close the gap.
For removing a mistake from a lecture you almost always want a ripple delete. A gap would show up as a black frame and silence in the export. Ripple edits shift all unlocked tracks, so keep the tracks linked, or lock the ones that must not move.
A worked example: splitting around a mistake
Suppose the speaker says the wrong term between 72 s and 80 s. The steps on the timeline are:
- Zoom the timeline in around 72 s.
- Place the playhead at 72 s and make sure both the video and audio clips are selected.
- Split. The clip is now two clips that share the source file.
- Move the playhead to 80 s and split again. You now have three clips, and the middle one holds the mistake.
- Select the middle clip and ripple delete it.
The remaining clips close up, and the project still holds the full source, so you can drag an edge back out and recover the removed part. The mistake was never erased, only left out of the timeline.
The same edit can be written as a command. This is the first scriptable example from the plan: it removes 72 s to 80 s from both video and audio and regenerates timestamps so playback stays continuous.
ffmpeg -i lecture.mp4 \
-vf "select='not(between(t,72,80))',setpts=N/FRAME_RATE/TB" \
-af "aselect='not(between(t,72,80))',asetpts=N/SR/TB" \
lecture_cut.mp4The select filter keeps frames whose time t is outside the range. The setpts filter then renumbers the kept frames so no gap remains, and asetpts does the same for audio samples. This corresponds to split, split, and ripple delete. Unlike a timeline editor, the command writes a new encoded file each time, so it has no undo. Keep the original and write to a new name.
Common errors
- Cutting with only one track selected. Video and audio end up at different lengths. Select both, or keep them linked.
- Using plain delete instead of ripple delete. A gap of black frames and silence remains.
- Cutting at a fully zoomed-out view. The playhead lands several frames from the intended point, and a syllable is clipped. Zoom the timeline in first.
- Treating timeline zoom as video zoom. Zooming the timeline changes only how you see it. Zooming the picture for viewers is a different operation, covered later.
- Editing the source file in place. Work on a copy of the project, and keep the original recording untouched so every edit stays reversible.
- Ignoring a variable frame rate. Cuts land on the wrong frame or audio drifts. Convert to a constant rate first.
Summary of the model
Source media stays fixed. Clips are ranges of that media. The timeline orders clips in time across tracks. The playhead is your position and the point where edits happen. Selection, snapping, and ripple behavior decide how an edit spreads to neighboring clips.
Exercise
A 30 fps lecture has a mistake from 00:01:12:00 to 00:01:20:00. You split at both points on the video track only, then ripple delete the middle video clip. The audio still contains the mistake and the audio track did not shorten. What went wrong, and what is the correct procedure?
Show answer
Only the video clip was selected when you split and deleted, so the audio was left whole and is now 8 seconds longer than the video, out of sync. The correct procedure is to select both the video and audio clips (or keep them linked) before each split, then ripple delete the middle section on both tracks. The timecodes mean 72 s to 80 s at 30 fps, an 8-second span of 240 frames.
Exercise
Explain the difference between a plain delete and a ripple delete, and say which one to use when removing a mistake from the middle of a lecture.
Show answer
A plain delete removes the clip and leaves an empty gap, which exports as black frames and silence. A ripple delete removes the clip and moves all later clips left to close the gap. Use ripple delete for a mistake in the middle of a lecture so playback continues without a pause.