Skip to content

Archive monetization

How to find ad-break points in archive content

Work in two steps. First collect candidate pauses: shot changes, black frames, silence and the end of a phrase. Then apply rules that keep breaks apart, away from the start, the end and the credits, and clear of speech. A person accepts or rejects the shortlist. Tools such as ffmpeg find candidates; the rules and the review decide which become breaks.

Published

Start with what a good break is

  • It sits in a natural pause of the story, not in the middle of a sentence.
  • It keeps some distance from speech, so the cut does not clip a word.
  • It lands on a frame that a player or packager can cut cleanly, normally a keyframe.
  • It stays out of the opening and closing credits and away from the first and last moments of the programme.
  • It is far enough from the previous break, and the total fits the limits your ad operations or contract set.

Step 1: collect candidates

ffmpeg can list timestamps for the usual pause signals without editing the file. The thresholds below are starting points, not recommendations; tune them per title and genre.

Black frames: look for black_start lines
ffmpeg -i episode.mp4 -vf "blackdetect=d=0.1:pix_th=0.10" -an -f null -
Silence: look for silence_start lines
ffmpeg -i episode.mp4 -af "silencedetect=noise=-35dB:d=0.5" -vn -f null -
Shot changes: look for pts_time values
ffmpeg -i episode.mp4 -vf "select='gt(scene,0.4)',showinfo" -an -f null -

None of these signals is a break on its own. Many files have no fades to black, silence often happens under music or effects, and a shot change is just a cut. They produce candidates.

Step 2: rank the candidates

  • A black frame together with a quiet stretch is stronger than either alone.
  • A shot change right after a speaker finishes is stronger than one in the middle of a conversation.
  • Speech timing matters most. Transcript or voice-activity timestamps give you the end of each phrase, so you can measure how far every candidate is from the nearest speech.
  • Keep the reason for each pick, such as “dark screen” or “end of a phrase”, so a reviewer can judge it quickly.

Step 3: apply the rules

Rules that turn candidates into breaks
RuleWhy it existsWhat you set
Skip the start and the endKeeps the opening and the close of the programme intactSeconds ignored at each end
Minimum gap between breaksStops breaks from clusteringShortest allowed distance between two breaks
Number of breaks by programme lengthA feature film and a short episode need different amountsMinimum and maximum breaks per length band
Minimum confidenceFilters weak candidates before a person sees themA score threshold
Distance from speechAvoids clipping dialogueShortest allowed gap to the nearest speech
CreditsOpening and closing credits are not story pausesDetect and exclude the credit range

There is no universal number for any of these. Take them from your ad operations policy and your platform’s rules, and test them on a few titles.

Step 4: put the break on a cuttable frame

For SCTE-35 and HLS markers the splice should fall on a keyframe or a segment boundary. Otherwise the packager has to cut late, or the player has to decode extra frames. This command lists video packets with a K flag for keyframes, so you can find the nearest one after each chosen time.

Keyframe times (packets with the K flag)
ffprobe -v error -select_streams v:0 -show_entries packet=pts_time,flags -of csv=p=0 episode.mp4 | grep ",K"

Step 5: review and export

Reviewing a shortlist of a dozen candidates is much faster than scrubbing a whole file, and a person keeps the last word on taste and context. Keep a record for every break: time, reason, confidence, distance to speech and whether it was accepted. That record lets you tune the rules later. Then write the accepted times in the form your downstream system ingests; this guide explains the options.

Doing it for a whole library

The method does not change at library scale, but consistency matters more. Use the same presets for programmes of the same length, process files as they arrive instead of in one big batch, and watch how often reviewers reject breaks, because that is the quickest signal that a rule is off.

AdBreak runs steps 1 to 4 on a finished file. It reads scene changes, dark frames, speech, silence, loudness and motion, applies presets set by programme length (minimum confidence, time skipped at the start and the end, the shortest gap between breaks and the minimum and maximum number of breaks), detects opening and closing credits apart from the breaks, and returns each break with a time, a reason, a confidence and the distance to speech. See how it works, or estimate the effort with the cost calculator.

Questions about this page

Keep reading

Request a pilot on your own files.

Send a few titles you have the rights to mark. Tell us whether you need pre-rolls, mid-rolls, or both, and how markers should reach you. For a large library, say so, and we will explain how files can be processed as they arrive. Pricing starts at $0.70 / €0.70 per hour of video and goes down as your monthly volume grows.