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

Function print_report

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

Source from the content-addressed store, hash-verified

1645}
1646
1647static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time)
1648{
1649 char buf[1024];
1650 AVBPrint buf_script;
1651 OutputStream *ost;
1652 AVFormatContext *oc;
1653 int64_t total_size;
1654 AVCodecContext *enc;
1655 int frame_number, vid, i;
1656 double bitrate;
1657 double speed;
1658 int64_t pts = INT64_MIN + 1;
1659 static int64_t last_time = -1;
1660 static int qp_histogram[52];
1661 int hours, mins, secs, us;
1662 int ret;
1663 float t;
1664
1665 if (!print_stats && !is_last_report && !progress_avio)
1666 return;
1667
1668 if (!is_last_report) {
1669 if (last_time == -1) {
1670 last_time = cur_time;
1671 return;
1672 }
1673 if ((cur_time - last_time) < 500000)
1674 return;
1675 last_time = cur_time;
1676 }
1677
1678 t = (cur_time-timer_start) / 1000000.0;
1679
1680
1681 oc = output_files[0]->ctx;
1682
1683 total_size = avio_size(oc->pb);
1684 if (total_size <= 0) // FIXME improve avio_size() so it works with non seekable output too
1685 total_size = avio_tell(oc->pb);
1686
1687 buf[0] = '\0';
1688 vid = 0;
1689 av_bprint_init(&buf_script, 0, 1);
1690 for (i = 0; i < nb_output_streams; i++) {
1691 float q = -1;
1692 ost = output_streams[i];
1693 enc = ost->enc_ctx;
1694 if (!ost->stream_copy)
1695 q = ost->quality / (float) FF_QP2LAMBDA;
1696
1697 if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1698 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
1699 av_bprintf(&buf_script, "stream_%d_%d_q=%.1f\n",
1700 ost->file_index, ost->index, q);
1701 }
1702 if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1703 float fps;
1704

Callers 1

transcodeFunction · 0.85

Calls 4

lrintfFunction · 0.85
psnrFunction · 0.85
print_final_statsFunction · 0.85
avio_tellFunction · 0.50

Tested by

no test coverage detected