aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dump.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2024-06-20 16:36:46 +0300
committerMartin Storsjö <martin@martin.st>2024-07-04 23:33:27 +0300
commite14cdf99905f2d1140f43d5791ecf57c64c5443e (patch)
tree2b72bb28147cf82129c7abb37ead14d35a89dfa6 /libavformat/dump.c
parent9246cca7f7db87ff972350d279c867b03eb8ef72 (diff)
downloadffmpeg-e14cdf99905f2d1140f43d5791ecf57c64c5443e.tar.gz
hlsenc: Calculate the average and actual maximum bitrate of segments
Previously, the bitrate advertised in the master playlist would only be based on the nominal values in either AVCodecParameters bit_rate, or via AVCPBProperties max_bitrate. On top of this, a fudge factor of 10% is added, to account for container overhead. Neither of these bitrates may be known, and if the encoder is running in VBR mode, there is no such value to be known. And the container overhead may be more or less than the given constant factor of 10%. Instead, calculate the maximum bitrate per segment based on what actually gets output from the muxer, and average bitrate across all segments. When muxing of the file finishes, update the master playlist with these values, exposing both the maximum (which previously was a guesstimate based on the nominal values) via EXT-X-STREAM-INF BANDWIDTH, and the average via EXT-X-STREAM-INF AVERAGE-BANDWIDTH. This makes it possible to use the hlsenc muxer with VBR encodes, for VOD style muxing. Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/dump.c')
0 files changed, 0 insertions, 0 deletions