MCPcopy Create free account
hub / github.com/byhook/ffmpeg4android / print_final_stats

Function print_final_stats

ffmpeg-single-cmd/src/main/cpp/ffmpeg_mod.c:1530–1645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1528}
1529
1530static void print_final_stats(int64_t total_size)
1531{
1532 uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0;
1533 uint64_t subtitle_size = 0;
1534 uint64_t data_size = 0;
1535 float percent = -1.0;
1536 int i, j;
1537 int pass1_used = 1;
1538
1539 for (i = 0; i < nb_output_streams; i++) {
1540 OutputStream *ost = output_streams[i];
1541 switch (ost->enc_ctx->codec_type) {
1542 case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
1543 case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
1544 case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
1545 default: other_size += ost->data_size; break;
1546 }
1547 extra_size += ost->enc_ctx->extradata_size;
1548 data_size += ost->data_size;
1549 if ( (ost->enc_ctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2))
1550 != AV_CODEC_FLAG_PASS1)
1551 pass1_used = 0;
1552 }
1553
1554 if (data_size && total_size>0 && total_size >= data_size)
1555 percent = 100.0 * (total_size - data_size) / data_size;
1556
1557 av_log(NULL, AV_LOG_INFO, "video:%1.0fkB audio:%1.0fkB subtitle:%1.0fkB other streams:%1.0fkB global headers:%1.0fkB muxing overhead: ",
1558 video_size / 1024.0,
1559 audio_size / 1024.0,
1560 subtitle_size / 1024.0,
1561 other_size / 1024.0,
1562 extra_size / 1024.0);
1563 if (percent >= 0.0)
1564 av_log(NULL, AV_LOG_INFO, "%f%%", percent);
1565 else
1566 av_log(NULL, AV_LOG_INFO, "unknown");
1567 av_log(NULL, AV_LOG_INFO, "\n");
1568
1569 /* print verbose per-stream stats */
1570 for (i = 0; i < nb_input_files; i++) {
1571 InputFile *f = input_files[i];
1572 uint64_t total_packets = 0, total_size = 0;
1573
1574 av_log(NULL, AV_LOG_VERBOSE, "Input file #%d (%s):\n",
1575 i, f->ctx->filename);
1576
1577 for (j = 0; j < f->nb_streams; j++) {
1578 InputStream *ist = input_streams[f->ist_index + j];
1579 enum AVMediaType type = ist->dec_ctx->codec_type;
1580
1581 total_size += ist->data_size;
1582 total_packets += ist->nb_packets;
1583
1584 av_log(NULL, AV_LOG_VERBOSE, " Input stream #%d:%d (%s): ",
1585 i, j, media_type_string(type));
1586 av_log(NULL, AV_LOG_VERBOSE, "%"PRIu64" packets read (%"PRIu64" bytes); ",
1587 ist->nb_packets, ist->data_size);

Callers 1

print_reportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected