[FFmpeg-cvslog] Merge commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846'

James Almer git at videolan.org
Sun Nov 12 05:18:46 EET 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Sun Nov 12 00:15:57 2017 -0300| [362372c46be6f4b885f741271687f2dae6435db9] | committer: James Almer

Merge commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846'

* commit '4723c6226aa1ece4099338cc9b38a9cef4fa4846':
  dashenc: fix bitrate estimation with correct scaling

Merged-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=362372c46be6f4b885f741271687f2dae6435db9
---

 libavformat/dashenc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 7813f4485a..d5554d1df0 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -1005,7 +1005,9 @@ static int dash_flush(AVFormatContext *s, int final, int stream)
 
         if (!os->bit_rate) {
             // calculate average bitrate of first segment
-            int64_t bitrate = (int64_t) range_length * 8 / ((os->max_pts - os->start_pts) * av_q2d(st->time_base));
+            int64_t bitrate = (int64_t) range_length * 8 * AV_TIME_BASE / av_rescale_q(os->max_pts - os->start_pts,
+                                                                                       st->time_base,
+                                                                                       AV_TIME_BASE_Q);
             if (bitrate >= 0) {
                 os->bit_rate = bitrate;
                 snprintf(os->bandwidth_str, sizeof(os->bandwidth_str),


======================================================================




More information about the ffmpeg-cvslog mailing list