[FFmpeg-user] Encoding for Amazon Cloud Front HLS adaptive streaming. Peak rate too high.

Joel Lopez badassmexican at gmail.com
Fri Nov 11 20:45:19 EET 2016


On Thu, Nov 10, 2016 at 8:25 AM, Carl Eugen Hoyos <ceffmpeg at gmail.com> wrote:
> 2016-11-08 22:08 GMT+01:00 Joel Lopez <badassmexican at gmail.com>:
>
>> For example a 2350k video bit rate and a 64k audio gives me 2878.02
>> kb/s measured when I expect 2414 kb/s.
>
> How would that be possible?
> Even if you know nothing about mpegts (don't worry, I don't know much
> about it myself), I hope you agree that it has to be some data structure
> that not only accepts varying sizes of video and audio frames (and
> allows to find them) but also (some) transmission errors - mpegts was
> specifically designed for lossy media. This cannot come for free, don't
> you agree?
> 20% overhead is too high but I would have to see command line,
> complete, uncut console output and output file size to be able to
> comment, maybe you should just remove the superfluous options
> like maxrate, bufsize and movflags and please decide if you want
> to use -force_key_frames or -g.
>
> (FFmpeg's mpegts muxer is known to have issues though.)
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


It turns out I've been going about this all wrong.  I don't need to
cap the bitrates further I just need a way to be able to get the max
bitrate and then add under 10% of that to the master playlist.  I
decided to run a video through Elastic Transcoder and then test it
with Media Stream Validator.

Below are the results for the 400K, 1M and 2M presents on Elastic
Transcoder. The 400k has an average of 474K with a 668k max.  The 1M
has an average of 1131K with a 2006K max.  The 2M has a 2234k average
with a 4217K max.  Then they're added to the playlist as 608k, 1825k
and 3835k.

How can I get the max bitrate using ffmpeg to automate the creation of
my master playlist?  Currently I have to just guess the max bitrate
then run the stream though Media Stream Validator to get the max and
then edit my master playlist with what it shows.

promo_400k.m3u8
Average segment duration: 10.040013
Total segment bitrates (all discontinuities): average: 474.69 kb/s,
max: 668.64 kb/s
Playlist max bitrate: 608.000000 kb/s
Video average IDR interval: 3.003000, Standard deviation: 0.000000

promo_1M.m3u8
Average segment duration: 10.041281
Total segment bitrates (all discontinuities): average: 1131.52 kb/s,
max: 2006.63 kb/s
Playlist max bitrate: 1825.000000 kb/s
Video average IDR interval: 3.003000, Standard deviation: 0.000000

promo_2M.m3u8
Average segment duration: 10.041281
Total segment bitrates (all discontinuities): average: 2234.81 kb/s,
max: 4217.60 kb/s
Playlist max bitrate: 3835.000000 kb/s
Video average IDR interval: 3.003000, Standard deviation: 0.000000


More information about the ffmpeg-user mailing list