From: Wang Cao <doublee...@gmail.com> It appears the initial intention was to print stats for the first output. Currently all output streams are aggregated for the final stats which is inconsistent with the "size" reported in print_report.
For example, when two outputs are specified, output 0 has size of 100 kB and output 1 has size of 50 kB. The output would look like: frame= 206 fps=3.6 q=0.0 LPSNR=Y:45.57 U:50.04 V:50.07 *:46.62 size= 100kB time=00:00:07.10 bitrate=1362.7kbits/s speed=0.124x video:140kB audio:79kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.382502% The "video" reported is larger than the previous line and this is confusing. Signed-off-by: Wang Cao <doublee...@gmail.com> --- fftools/ffmpeg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index 2e9448ea2b..07396204b6 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -1516,6 +1516,7 @@ static int reap_filters(int flush) static void print_final_stats(int64_t total_size) { + AVFormatContext *oc; uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0; uint64_t subtitle_size = 0; uint64_t data_size = 0; @@ -1523,7 +1524,9 @@ static void print_final_stats(int64_t total_size) int i, j; int pass1_used = 1; - for (i = 0; i < nb_output_streams; i++) { + oc = output_files[0]->ctx; + + for (i = 0; i < oc->nb_streams; i++) { OutputStream *ost = output_streams[i]; switch (ost->enc_ctx->codec_type) { case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break; @@ -1674,7 +1677,7 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti vid = 0; av_bprint_init(&buf, 0, AV_BPRINT_SIZE_AUTOMATIC); av_bprint_init(&buf_script, 0, AV_BPRINT_SIZE_AUTOMATIC); - for (i = 0; i < nb_output_streams; i++) { + for (i = 0; i < oc->nb_streams; i++) { float q = -1; ost = output_streams[i]; enc = ost->enc_ctx; -- 2.27.0.212.ge8ba1cc988-goog _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".