Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-03-24 19:25:31 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-03-24 19:30:29 +0400
commitafa442c198fcbfe587887a4318d61e19539afc2d (patch)
treee4ee4899f4ecb5eae12f1b25172e67bd016419f5 /ffmpeg.c
parentecb5b9c098009787e02f6de9e2d3e1786531c2f2 (diff)
parenta220b07b0f971f88213aef012aea51af2800be62 (diff)
Merge commit 'a220b07b0f971f88213aef012aea51af2800be62'
* commit 'a220b07b0f971f88213aef012aea51af2800be62': avconv: split printing the final statistics into a separate function Conflicts: ffmpeg.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c79
1 files changed, 42 insertions, 37 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 753b777f3c..1b7efa8fee 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1178,6 +1178,46 @@ static int reap_filters(void)
return 0;
}
+static void print_final_stats(int64_t total_size)
+{
+ uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0;
+ uint64_t subtitle_size = 0;
+ uint64_t data_size = 0;
+ float percent = -1.0;
+ int i;
+
+ for (i = 0; i < nb_output_streams; i++) {
+ OutputStream *ost = output_streams[i];
+ switch (ost->st->codec->codec_type) {
+ case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
+ case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
+ case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
+ default: other_size += ost->data_size; break;
+ }
+ extra_size += ost->st->codec->extradata_size;
+ data_size += ost->data_size;
+ }
+
+ if (data_size && total_size >= data_size)
+ percent = 100.0 * (total_size - data_size) / data_size;
+
+ av_log(NULL, AV_LOG_INFO, "\n");
+ 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: ",
+ video_size / 1024.0,
+ audio_size / 1024.0,
+ subtitle_size / 1024.0,
+ other_size / 1024.0,
+ extra_size / 1024.0);
+ if (percent >= 0.0)
+ av_log(NULL, AV_LOG_INFO, "%f%%", percent);
+ else
+ av_log(NULL, AV_LOG_INFO, "unknown");
+ av_log(NULL, AV_LOG_INFO, "\n");
+ if(video_size + data_size + audio_size + subtitle_size + extra_size == 0){
+ av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n");
+ }
+}
+
static void print_report(int is_last_report, int64_t timer_start, int64_t cur_time)
{
char buf[1024];
@@ -1339,43 +1379,8 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
}
}
- if (is_last_report) {
- uint64_t video_size = 0, audio_size = 0, extra_size = 0, other_size = 0;
- uint64_t subtitle_size = 0;
- uint64_t data_size = 0;
- float percent = -1.0;
-
- for (i = 0; i < nb_output_streams; i++) {
- OutputStream *ost = output_streams[i];
- switch (ost->st->codec->codec_type) {
- case AVMEDIA_TYPE_VIDEO: video_size += ost->data_size; break;
- case AVMEDIA_TYPE_AUDIO: audio_size += ost->data_size; break;
- case AVMEDIA_TYPE_SUBTITLE: subtitle_size += ost->data_size; break;
- default: other_size += ost->data_size; break;
- }
- extra_size += ost->st->codec->extradata_size;
- data_size += ost->data_size;
- }
-
- if (data_size && total_size >= data_size)
- percent = 100.0 * (total_size - data_size) / data_size;
-
- av_log(NULL, AV_LOG_INFO, "\n");
- 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: ",
- video_size / 1024.0,
- audio_size / 1024.0,
- subtitle_size / 1024.0,
- other_size / 1024.0,
- extra_size / 1024.0);
- if (percent >= 0.0)
- av_log(NULL, AV_LOG_INFO, "%f%%", percent);
- else
- av_log(NULL, AV_LOG_INFO, "unknown");
- av_log(NULL, AV_LOG_INFO, "\n");
- if(video_size + data_size + audio_size + subtitle_size + extra_size == 0){
- av_log(NULL, AV_LOG_WARNING, "Output file is empty, nothing was encoded (check -ss / -t / -frames parameters if used)\n");
- }
- }
+ if (is_last_report)
+ print_final_stats(total_size);
}
static void flush_encoders(void)