Re: [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg.c: Use the streams from the first output in print_final_stats.

2020-07-17 Thread Wang Cao
Hi,

I am wondering if this is a change that would make unpredictable impact on
the stats report for ffmpeg. If this is the case, can you take a look at my
next patch in the series? It adds an option to print stats for each output
file when enabled. Thank you!

Best,
Wang
___
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".

Re: [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg.c: Use the streams from the first output in print_final_stats.

2020-07-07 Thread Wang Cao
Friendly ping here. Is there something I need to change for this patch set?
Any comments are welcome. Thank you!
___
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".

[FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg.c: Use the streams from the first output in print_final_stats.

2020-06-26 Thread Wang Cao
From: Wang Cao 

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 
---
 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(, 0, AV_BPRINT_SIZE_AUTOMATIC);
 av_bprint_init(_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".