diff --git a/avconv.c b/avconv.c
index 8526961f7a017fc2e7315d524ecce3944aa608bd..f9ad054276ef0c9e7a600fee44d2247d259efd76 100644
--- a/avconv.c
+++ b/avconv.c
@@ -1475,8 +1475,8 @@ static void do_video_out(AVFormatContext *s,
                     pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
 
                 write_frame(s, &pkt, ost);
-                *frame_size = ret;
-                video_size += ret;
+                *frame_size = pkt.size;
+                video_size += pkt.size;
 
                 /* if two pass, output log */
                 if (ost->logfile && enc->stats_out) {