1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

avconv: fix counting encoded video size.

avcodec_encode_video2() return value is 0 on success, encoded frame size
is stored in the packet.
This commit is contained in:
Anton Khirnov 2012-03-06 08:57:58 +01:00
parent 632eb1bbae
commit 39da3b223f

View File

@ -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); pkt.dts = av_rescale_q(pkt.dts, enc->time_base, ost->st->time_base);
write_frame(s, &pkt, ost); write_frame(s, &pkt, ost);
*frame_size = ret; *frame_size = pkt.size;
video_size += ret; video_size += pkt.size;
/* if two pass, output log */ /* if two pass, output log */
if (ost->logfile && enc->stats_out) { if (ost->logfile && enc->stats_out) {