avconv: fix counting encoded video size.
authorAnton Khirnov <anton@khirnov.net>
Tue, 6 Mar 2012 07:57:58 +0000 (08:57 +0100)
committerAnton Khirnov <anton@khirnov.net>
Tue, 6 Mar 2012 09:06:21 +0000 (10:06 +0100)
avcodec_encode_video2() return value is 0 on success, encoded frame size
is stored in the packet.

avconv.c

index 8526961..f9ad054 100644 (file)
--- 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) {