Re: [FFmpeg-devel] [PATCH v2 1/7] dashenc: fix bitrate estimation with correct scaling

2017-10-29 Thread Michael Niedermayer
On Sun, Oct 29, 2017 at 04:10:34PM +0100, Peter Große wrote:
> From: Anton Schubert 
> 
> Signed-off-by: Anton Schubert 
> Signed-off-by: Peter Große 
> ---
> v2: Fixed double rescaling.
> 
>  libavformat/dashenc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

will apply

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v2 1/7] dashenc: fix bitrate estimation with correct scaling

2017-10-29 Thread Peter Große
From: Anton Schubert 

Signed-off-by: Anton Schubert 
Signed-off-by: Peter Große 
---
v2: Fixed double rescaling.

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

diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
index 04b0fd99e6..e25a660fbe 100644
--- a/libavformat/dashenc.c
+++ b/libavformat/dashenc.c
@@ -947,6 +947,7 @@ static int dash_flush(AVFormatContext *s, int final, int 
stream)
 
 for (i = 0; i < s->nb_streams; i++) {
 OutputStream *os = >streams[i];
+AVStream *st = s->streams[i];
 char filename[1024] = "", full_path[1024], temp_path[1024];
 int range_length, index_length = 0;
 
@@ -1001,7 +1002,7 @@ 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 * AV_TIME_BASE / 
(os->max_pts - os->start_pts);
+int64_t bitrate = (int64_t) range_length * 8 / ((os->max_pts - 
os->start_pts) * av_q2d(st->time_base));
 if (bitrate >= 0) {
 os->bit_rate = bitrate;
 snprintf(os->bandwidth_str, sizeof(os->bandwidth_str),
-- 
2.13.6

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel