Exact rational math
Frame rates are parsed as fractions (29.97 → 30000/1001). A duration is only listed when a whole number of video frames and a whole number of AAC packets end at the same instant.
Tool
Find GOP and segment durations where whole video GOPs and whole AAC audio packets end at exactly the same instant — for HLS, MPEG-DASH, and CMAF segmented workflows.
Try 30 fps, then 29.97 — before you switch, predict how the results will change.
First, the pieces. Video is a stream of frames. Frames travel in groups called GOPs (groups of pictures), and a player can only start decoding at the start of a GOP — that’s why picking a good GOP length matters. Audio travels separately as AAC packets (AAC is the standard audio format for streaming). Each packet is a fixed clump of samples, and it can no more be split than a frame can. A segment is the small file an HLS or DASH player actually downloads. It must be built from whole GOPs and whole packets, so it can only end at an instant where a frame finishes and a packet finishes.
The graphic below is a timeline: time runs left to right, and both rows cover the exact same stretch of it. The top row marks every video frame boundary — the exact instant one frame ends and the next begins. The bottom row marks every audio packet boundary. A boundary is the only place a stream can be cut without splitting something in half.
Frames and packets last different amounts of time, so their boundaries almost never land on the same instant — watch the near misses along the middle. A gold line marks the rare instant where a frame boundary and a packet boundary land together: a valid cut point. Segments can only end there. Press ▶ Play to watch the boundaries tick by until they line up, and hover any mark for its exact time.
The graphic below turns that into two rulers on one timeline: time runs left to right, and both rows cover the exact same stretch of it. The top ruler drops a blue tick at the instant each video frame ends — the only places video can be cut. The bottom ruler drops a green tick at the instant each AAC audio packet ends — the only places audio can be cut.
Because one frame and one packet last different amounts of time, the two rows drift out of step — look along the middle and you’ll see blue and green ticks just missing each other. Only at the gold lines do a blue tick and a green tick land at exactly the same instant. Those are the only spots a segment can end cleanly. Any GOP length that ends on one keeps video and audio aligned; cut anywhere else and an audio packet gets sliced in half. Press ▶ Play to watch the marks race until they meet, and hover any mark for its exact time.
Think of the graphic below as a bus timetable. Two lines leave the same stop at time 0, each on a perfectly steady schedule. The blue line (top row) has a departure every time a video frame ends — the only places video can be cut. The green line (bottom row) departs every time an AAC audio packet ends — the only places audio can be cut.
Because the two schedules run on different gaps, the departures drift apart — a blue bus leaves, a green bus just after, almost never together. Only at the gold lines do both lines pull away at exactly the same instant. It’s the classic puzzle: one bus every 4 minutes and another every 6 first leave together at minute 12 — except here the gaps are fractions of a second. Those shared departures are the only spots a segment can end cleanly; cut anywhere else and an audio packet gets sliced in half. Press ▶ Play to watch a day of departures, and hover any stop for its exact time.
Each row is an aligned duration. Use it as one long GOP, or split it into several shorter aligned GOPs per segment.
| Frames | Duration | Δ vs target | AAC packets | GOPs per segment |
|---|
| Frames | Duration | AAC packets |
|---|
Notes
All arithmetic runs on exact integer ratios in your browser — NTSC rates like 29.97 never drift or produce rounded false positives.
Frame rates are parsed as fractions (29.97 → 30000/1001). A duration is only listed when a whole number of video frames and a whole number of AAC packets end at the same instant.
A segment can hold several aligned GOPs: 3.84 s segments at 25 fps can use two 1.92 s GOPs. The match table shows every way to divide each candidate.
At 30000/1001 fps with 48 kHz AAC, true alignment only occurs every 640 frames (≈21.35 s). Shorter NTSC segments always split an audio packet across a boundary.