Skip to content

Transcode reasons

Nils Lehnen edited this page Sep 6, 2026 · 1 revision

Transcode reasons

The reason counts add up to more than the plays, and that is the right answer. This page exists because the two numbers appear next to each other and a reader who meets them without this sentence concludes the plugin is counting wrong.

The full argument, with the code each claim is read from, is docs/transcode-reasons.md.

Two questions, and only one of them is a partition

How each play was delivered has exactly one answer per play. The server reports a method when the play starts and it is kept as it was read: direct play, direct stream, transcode, or unknown. Four values, one per play, so those four shares do add up to the play count for a range.

A play the server never reported a method for is reported as unknown and is never counted as direct. Counting missing information as the good outcome makes a chart where an absent answer looks like success.

Why a play was not passed through has as many answers per play as the server gave, and a server usually gives more than one. A play whose audio codec the client cannot handle and whose container the client cannot read carries both. The reasons are kept as a list on the play, so a breakdown of reasons is a count of reason sightings and not a count of plays.

What the list does and does not repeat

Within one play a reason appears once, however many times the server repeated it while the play ran. So a row saying a reason was seen four hundred times is four hundred plays that hit it, not four hundred progress reports on one long film.

What it is not is a partition, because those same four hundred plays are also counted under every other reason they carried.

The watched time does the same thing

The whole of a play's watched time goes under every reason it carries. A ninety-minute play with three reasons on it puts ninety minutes under each of the three, so the column totals two hundred and seventy over a range that holds ninety.

The alternative was dividing the play's time between its reasons, and it was refused: thirty minutes under the container is a length of time nobody watched. The server did not spend a third of that play on the container and the rest on the codecs; it re-encoded one play under all three conditions at once, and every figure the division produced would be arithmetic on top of an observation rather than the observation.

Because the times are not a partition either, the total for the period is carried as its own figure rather than left to be summed from the rows.

What the rows are ordered by

By the watched time under each reason, not by the plays. Four hundred one-minute plays under one reason and four two-hour plays under another are a hundred to one on a count and the other way round on the time, and only the second is a server spending its evening re-encoding. Both figures are carried, because the two readings disagree and the disagreement is the part worth seeing.

The names

The reason names are the server's own, unchanged and never tidied. An administrator meets these words in the server's log, and a plugin that renamed them would print something that cannot be looked up. The sentence explaining a reason is written beside the row rather than in place of the name.

Clone this wiki locally