[FFmpeg-devel] [PATCH] ffmpeg: add -progress option.
Stefano Sabatini
stefasab at gmail.com
Thu Jul 12 01:54:57 CEST 2012
On date Sunday 2012-07-08 13:41:22 +0200, Nicolas George encoded:
> It allows to send program-friendly (easy to parse)
> progress information to a file or an URL.
>
> Signed-off-by: Nicolas George <nicolas.george at normalesup.org>
[...]
> @@ -2135,14 +2151,35 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
> (100 * us) / AV_TIME_BASE);
> snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
> "bitrate=%6.1fkbits/s", bitrate);
> + av_bprintf(&buf_script, "total_size=%"PRId64"\n", total_size);
> + av_bprintf(&buf_script, "out_time_ms=%"PRId64"\n", pts);
> + av_bprintf(&buf_script, "out_time=%02d:%02d:%02d.%06d\n",
> + hours, mins, secs, us);
>
> if (nb_frames_dup || nb_frames_drop)
> snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " dup=%d drop=%d",
> nb_frames_dup, nb_frames_drop);
> + av_bprintf(&buf_script, "dup=%d\n", nb_frames_dup);
> + av_bprintf(&buf_script, "drop=%d\n", nb_frames_drop);
>
> + if (print_stats || is_last_report) {
> av_log(NULL, AV_LOG_INFO, "%s \r", buf);
>
> fflush(stderr);
> + }
unrelated?
[...]
Also could you show an instance of such an output? Just in case we
have some ideas for making it more beatiful.
(Note: there is always the parsing problem, again a generic solution
may involve a writer API).
Looks good otherwise (but maybe wait a comment from Michael).
--
FFmpeg = Fundamentalist & Fabulous Moronic Prodigious Ecstatic Goblin
More information about the ffmpeg-devel
mailing list