[FFmpeg-cvslog] ffmpeg: Add bitrate value under -progress action

raxon1s git at videolan.org
Fri Jan 16 01:14:07 CET 2015


ffmpeg | branch: master | raxon1s <teoubas.liv at gmail.com> | Thu Jan  8 03:50:15 2015 +0100| [4184d344af4ab3dfb9b5e119b9a48f950a458ef4] | committer: Michael Niedermayer

ffmpeg: Add bitrate value under -progress action

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4184d344af4ab3dfb9b5e119b9a48f950a458ef4
---

 ffmpeg.c |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index f9aa65f..c283c96 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1526,10 +1526,15 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
              "%02d:%02d:%02d.%02d ", hours, mins, secs,
              (100 * us) / AV_TIME_BASE);
-    if (bitrate < 0) snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-                              "bitrate=N/A");
-    else             snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-                              "bitrate=%6.1fkbits/s", bitrate);
+
+    if (bitrate < 0) {
+        snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),"bitrate=N/A");
+        av_bprintf(&buf_script, "bitrate=N/A\n");
+    }else{
+        snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),"bitrate=%6.1fkbits/s", bitrate);
+        av_bprintf(&buf_script, "bitrate=%6.1fkbits/s\n", bitrate);
+    }
+
     if (total_size < 0) av_bprintf(&buf_script, "total_size=N/A\n");
     else                av_bprintf(&buf_script, "total_size=%"PRId64"\n", total_size);
     av_bprintf(&buf_script, "out_time_ms=%"PRId64"\n", pts);



More information about the ffmpeg-cvslog mailing list