@@ -851,7 +851,7 @@ static void do_video_stats(OutputStream *ost, int frame_size)
}
enc = ost->enc_ctx;
- frame_number = ost->st->nb_frames;
+ frame_number = ost->packets_encoded;
if (vstats_version <= 1) {
fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number,
ost->quality / (float)FF_QP2LAMBDA);
@@ -945,6 +945,8 @@ static int encode_frame(OutputFile *of, OutputStream *ost, AVFrame *frame)
if (enc->codec_type == AVMEDIA_TYPE_VIDEO && vstats_filename)
do_video_stats(ost, pkt->size);
+ ost->packets_encoded++;
+
output_packet(of, pkt, ost, 0);
/* if two pass, output log */
@@ -551,6 +551,8 @@ typedef struct OutputStream {
// number of frames/samples sent to the encoder
uint64_t frames_encoded;
uint64_t samples_encoded;
+ // number of packets received from the encoder
+ uint64_t packets_encoded;
/* packet quality factor */
int quality;