"filesize" variable is size of MPD file(MPEG-DASH) or M3U8 playlist file(HLS). So, the bitrate is calculated deviding size of playlist or manifest file(not segment files) by duration.
On Fri, Jul 17, 2020 at 05:21:42PM +0900, Dongwon Kim wrote: > Signed-off-by: Dongwon Kim <dongwon....@sk.com> > Signed-off-by: Dongwon Kim <dongwon00....@gmail.com> > --- > libavformat/utils.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/libavformat/utils.c b/libavformat/utils.c > index 807d9f10cb..e90467e2e0 100644 > --- a/libavformat/utils.c > +++ b/libavformat/utils.c > @@ -2715,7 +2715,8 @@ static void update_stream_timings(AVFormatContext *ic) > if (duration != INT64_MIN && duration > 0 && ic->duration == > AV_NOPTS_VALUE) { > ic->duration = duration; > } > - if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) { > + if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0 > + && strcmp(ic->iformat->name, "hls") && strcmp(ic->iformat->name, > "dash")) { > /* compute the bitrate */ > double bitrate = (double) filesize * 8.0 * AV_TIME_BASE / > (double) ic->duration; > -- > 2.25.1 > _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".