[FFmpeg-cvslog] avdevice/decklink_dec: fix bitrate calculations

Marton Balint git at videolan.org
Sun Jun 26 19:20:07 CEST 2016


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Sun Jun 19 19:20:00 2016 +0200| [340cea9f22c162e10d120835661e132721b7454b] | committer: Marton Balint

avdevice/decklink_dec: fix bitrate calculations

Reviewed-by: Deti Fliegl <deti at fliegl.de>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavdevice/decklink_dec.cpp |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavdevice/decklink_dec.cpp b/libavdevice/decklink_dec.cpp
index 1c305f3..3b5d4be 100644
--- a/libavdevice/decklink_dec.cpp
+++ b/libavdevice/decklink_dec.cpp
@@ -563,15 +563,16 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
 
     st->time_base.den      = ctx->bmd_tb_den;
     st->time_base.num      = ctx->bmd_tb_num;
-    st->codecpar->bit_rate    = av_image_get_buffer_size((AVPixelFormat)st->codecpar->format, ctx->bmd_width, ctx->bmd_height, 1) * 1/av_q2d(st->time_base) * 8;
 
     if (cctx->v210) {
         st->codecpar->codec_id    = AV_CODEC_ID_V210;
         st->codecpar->codec_tag   = MKTAG('V', '2', '1', '0');
+        st->codecpar->bit_rate    = av_rescale(ctx->bmd_width * ctx->bmd_height * 64, st->time_base.den, st->time_base.num * 3);
     } else {
         st->codecpar->codec_id    = AV_CODEC_ID_RAWVIDEO;
         st->codecpar->format      = AV_PIX_FMT_UYVY422;
         st->codecpar->codec_tag   = MKTAG('U', 'Y', 'V', 'Y');
+        st->codecpar->bit_rate    = av_rescale(ctx->bmd_width * ctx->bmd_height * 16, st->time_base.den, st->time_base.num);
     }
 
     avpriv_set_pts_info(st, 64, 1, 1000000);  /* 64 bits pts in us */



More information about the ffmpeg-cvslog mailing list