A transcode is reported with no bitrate until ffmpeg names one #174
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A running transcode is reported with no bitrate at all until ffmpeg names one,
where upstream falls back to the bitrate the job was asked to produce.
Seen in the player statistics of a transcoding HLS playback. Upstream's
Transcoding Info carries
Bitrate 16.6 Mbpsbeside the codecs; ours carriesthe codecs, the channel count and nothing else:
The bundle draws that value only when
TranscodingInfo.Bitrateis truthy, andours was not there.
crates/ephyra-http/src/map/session.rs::transcodingfills it from the encoder'sown account of itself and from nothing else:
Upstream reports the same field from the progress line or from the job:
TranscodeManager.ReportTranscodingProgressends inand
EncodingJobInfo.TotalOutputBitrateis(OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0)— settled before ffmpeg starts, so a session is neverwithout one.
What it costs. ffmpeg writes
bitrate=N/Auntil it has written enough toaverage over, so every transcode reads as bitrate-less for its first seconds —
and a job whose progress never carries one reads that way for its whole life.
The dashboard's Now Playing tile and the player statistics both draw from this
field, and a session that is plainly transcoding at some rate shows none.
Where to start
streaming::transcode::Targetis what the route already has to hand and itcarries what the job was asked for — the codecs, the size, the channels. It does
not carry the two output bitrates, so they have to be put on it where the rest of
the target is settled; the sum is upstream's
TotalOutputBitrate, and theprogress line's own figure still wins where there is one.
How to know it is done
A session whose progress carries no bitrate is reported with the target's, and
one whose progress carries a bitrate is reported with that. Both fail today —
the first reports nothing, and there is no second to break.
House rules
CLAUDE.mdis the short version and these are the parts that bite: tests rununder
cargo nextest; upstream's source is the checkout inupstream/at thepin; generated files are regenerated rather than edited; a comment says what
the code does, not how it got there.
A test that cannot fail is worse than none.