diff --git a/ffserver.c b/ffserver.c
index f2cf67f..096c160 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2095,7 +2095,7 @@ static void compute_status(HTTPContext *c)
                 default:
                     abort();
                 }
-                avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%d<td>%s<td>%s\n",
+                avio_printf(pb, "<tr><td align=right>%d<td>%s<td align=right>%lld<td>%s<td>%s\n",
                         i, type, st->codec->bit_rate/1000, codec ? codec->name : "", parameters);
             }
             avio_printf(pb, "</table>\n");
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 012a31c..af10e55 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1605,7 +1605,7 @@ typedef struct AVCodecContext {
      * - encoding: Set by user; unused for constant quantizer encoding.
      * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
      */
-    int bit_rate;
+    int64_t bit_rate;
 
     /**
      * number of bits the bitstream is allowed to diverge from the reference.
@@ -1613,7 +1613,7 @@ typedef struct AVCodecContext {
      * - encoding: Set by user; unused for constant quantizer encoding.
      * - decoding: unused
      */
-    int bit_rate_tolerance;
+    int64_t bit_rate_tolerance;
 
     /**
      * Global quality for codecs which cannot change it per frame.
diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c
index fe7c4a7..0f5c9a2 100644
--- a/libavcodec/pcm-mpeg.c
+++ b/libavcodec/pcm-mpeg.c
@@ -116,7 +116,7 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx,
 
     if (avctx->debug & FF_DEBUG_PICT_INFO)
         av_dlog(avctx,
-                "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n",
+                "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %lld bit/s\n",
                 avctx->channels, avctx->bits_per_coded_sample,
                 avctx->sample_rate, avctx->bit_rate);
     return 0;
diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c
index 06b22c0..708e2fc 100644
--- a/libavcodec/sipr.c
+++ b/libavcodec/sipr.c
@@ -492,7 +492,7 @@ static av_cold int sipr_decoder_init(AVCodecContext * avctx)
         else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5;
         else                              ctx->mode = MODE_5k0;
         av_log(avctx, AV_LOG_WARNING,
-               "Invalid block_align: %d. Mode %s guessed based on bitrate: %d\n",
+               "Invalid block_align: %d. Mode %s guessed based on bitrate: %lld\n",
                avctx->block_align, modes[ctx->mode].mode_name, avctx->bit_rate);
     }
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index f5ceae4..5467db5 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -738,9 +738,9 @@ static void avcodec_get_subtitle_defaults(AVSubtitle *sub)
     sub->pts = AV_NOPTS_VALUE;
 }
 
-static int get_bit_rate(AVCodecContext *ctx)
+static int64_t get_bit_rate(AVCodecContext *ctx)
 {
-    int bit_rate;
+    int64_t bit_rate;
     int bits_per_sample;
 
     switch (ctx->codec_type) {
@@ -1016,7 +1016,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
         }
         if (   (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO)
             && avctx->bit_rate>0 && avctx->bit_rate<1000) {
-            av_log(avctx, AV_LOG_WARNING, "Bitrate %d is extreemly low, did you mean %dk\n", avctx->bit_rate, avctx->bit_rate);
+            av_log(avctx, AV_LOG_WARNING, "Bitrate %lld is extreemly low, did you mean %lldk\n", avctx->bit_rate, avctx->bit_rate);
         }
     }
 
@@ -2039,7 +2039,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
     const char *codec_name;
     const char *profile = NULL;
     const AVCodec *p;
-    int bitrate;
+    int64_t bitrate;
     AVRational display_aspect_ratio;
 
     if (!buf || buf_size <= 0)
@@ -2131,7 +2131,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
     bitrate = get_bit_rate(enc);
     if (bitrate != 0) {
         snprintf(buf + strlen(buf), buf_size - strlen(buf),
-                 ", %d kb/s", bitrate / 1000);
+                 ", %lld kb/s", bitrate / 1000);
     }
 }
 
diff --git a/libavcodec/wma.c b/libavcodec/wma.c
index d0c0b34..077c547 100644
--- a/libavcodec/wma.c
+++ b/libavcodec/wma.c
@@ -181,7 +181,7 @@ int ff_wma_init(AVCodecContext *avctx, int flags2)
         }
     }
     av_dlog(s->avctx, "flags2=0x%x\n", flags2);
-    av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n",
+    av_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%lld block_align=%d\n",
             s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate,
             avctx->block_align);
     av_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n",
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c
index 5aebe81..590d561 100644
--- a/libavcodec/wmaenc.c
+++ b/libavcodec/wmaenc.c
@@ -45,7 +45,7 @@ static int encode_init(AVCodecContext * avctx){
     }
 
     if(avctx->bit_rate < 24*1000) {
-        av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %i, need 24000 or higher\n",
+        av_log(avctx, AV_LOG_ERROR, "bitrate too low: got %lli, need 24000 or higher\n",
                avctx->bit_rate);
         return AVERROR(EINVAL);
     }
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index c907d4e..0a6f496 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1008,7 +1008,7 @@ typedef struct AVFormatContext {
      * available. Never set it directly if the file_size and the
      * duration are known as FFmpeg can compute it automatically.
      */
-    int bit_rate;
+    int64_t bit_rate;
 
     unsigned int packet_size;
     int max_delay;
diff --git a/libavformat/g729dec.c b/libavformat/g729dec.c
index 794558e..39c12c4 100644
--- a/libavformat/g729dec.c
+++ b/libavformat/g729dec.c
@@ -57,7 +57,7 @@ static int g729_read_header(AVFormatContext *s)
     } else if (s->bit_rate == 8000) {
         st->codec->block_align = 10;
     } else {
-        av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %d b/s\n", s->bit_rate);
+        av_log(s, AV_LOG_ERROR, "Only 8000 b/s and 6400 b/s bitrates are supported. Provided: %lld b/s\n", s->bit_rate);
         return AVERROR_INVALIDDATA;
     }
 
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index f08aa7e..a8705ca 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2416,7 +2416,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov)
         } else {
             continue;
         }
-        avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type,
+        avio_printf(pb, "<%s systemBitrate=\"%lld\">\n", type,
                                                        track->enc->bit_rate);
         param_write_int(pb, "systemBitrate", track->enc->bit_rate);
         param_write_int(pb, "trackID", track_id);
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 695323a..6f88059 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -443,7 +443,7 @@ real_parse_asm_rule(AVStream *st, const char *p, const char *end)
 {
     do {
         /* can be either averagebandwidth= or AverageBandwidth= */
-        if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codec->bit_rate) == 1)
+        if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%lld", &st->codec->bit_rate) == 1)
             break;
         if (!(p = strchr(p, ',')) || p > end)
             p = end;
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index cdc3e21..6a0cc93 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -624,7 +624,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx,
     av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type);
     sdp_write_address(buff, size, dest_addr, dest_type, ttl);
     if (c->bit_rate) {
-        av_strlcatf(buff, size, "b=AS:%d\r\n", c->bit_rate / 1000);
+        av_strlcatf(buff, size, "b=AS:%lld\r\n", c->bit_rate / 1000);
     }
 
     sdp_write_media_attributes(buff, size, c, payload_type, fmt);
diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 096bf79..ac82259 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -255,7 +255,7 @@ static int write_manifest(AVFormatContext *s, int final)
             if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_VIDEO)
                 continue;
             last = i;
-            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->width, s->streams[i]->codec->height, os->private_str);
+            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%lld\" FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->width, s->streams[i]->codec->height, os->private_str);
             index++;
         }
         output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
@@ -269,7 +269,7 @@ static int write_manifest(AVFormatContext *s, int final)
             if (s->streams[i]->codec->codec_type != AVMEDIA_TYPE_AUDIO)
                 continue;
             last = i;
-            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%d\" FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" BitsPerSample=\"16\" PacketSize=\"%d\" AudioTag=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->sample_rate, s->streams[i]->codec->channels, os->packet_size, os->audio_tag, os->private_str);
+            avio_printf(out, "<QualityLevel Index=\"%d\" Bitrate=\"%lld\" FourCC=\"%s\" SamplingRate=\"%d\" Channels=\"%d\" BitsPerSample=\"16\" PacketSize=\"%d\" AudioTag=\"%d\" CodecPrivateData=\"%s\" />\n", index, s->streams[i]->codec->bit_rate, os->fourcc, s->streams[i]->codec->sample_rate, s->streams[i]->codec->channels, os->packet_size, os->audio_tag, os->private_str);
             index++;
         }
         output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size);
@@ -317,7 +317,7 @@ static int ism_write_header(AVFormatContext *s)
             ret = AVERROR(EINVAL);
             goto fail;
         }
-        snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codec->bit_rate);
+        snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%lld)", s->filename, s->streams[i]->codec->bit_rate);
         if (mkdir(os->dirname, 0777) < 0) {
             ret = AVERROR(errno);
             av_log(s, AV_LOG_ERROR, "mkdir failed\n");
diff --git a/libavformat/utils.c b/libavformat/utils.c
index a78da36..4bcae7f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2374,7 +2374,7 @@ static void estimate_timings(AVFormatContext *ic, int64_t old_offset)
                     (double) st->start_time / AV_TIME_BASE,
                     (double) st->duration   / AV_TIME_BASE);
         }
-        av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
+        av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%lld kb/s\n",
                 (double) ic->start_time / AV_TIME_BASE,
                 (double) ic->duration   / AV_TIME_BASE,
                 ic->bit_rate / 1000);
@@ -3516,7 +3516,7 @@ void av_dump_format(AVFormatContext *ic,
         }
         av_log(NULL, AV_LOG_INFO, ", bitrate: ");
         if (ic->bit_rate) {
-            av_log(NULL, AV_LOG_INFO,"%d kb/s", ic->bit_rate / 1000);
+            av_log(NULL, AV_LOG_INFO,"%lld kb/s", ic->bit_rate / 1000);
         } else {
             av_log(NULL, AV_LOG_INFO, "N/A");
         }
diff --git a/libavformat/vqf.c b/libavformat/vqf.c
index f1e6aaf..0ffb7cc 100644
--- a/libavformat/vqf.c
+++ b/libavformat/vqf.c
@@ -200,7 +200,7 @@ static int vqf_read_header(AVFormatContext *s)
         size = 2048;
         break;
     default:
-        av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %d kb/s.\n",
+        av_log(s, AV_LOG_ERROR, "Mode not suported: %d Hz, %lld kb/s.\n",
                st->codec->sample_rate, st->codec->bit_rate);
         return -1;
     }
