From: Chema Gonzalez <ch...@google.com>

Example:

$ ffplay -vf 
"drawtext=fontfile=/usr/share/fonts/truetype/ubuntu-font-family/UbuntuMono-R.ttf:text='%{pict_type}
%{pts\:hms} %{pts\:raw} %{eif\:n\:u}':
fontcolor=white@0.8:fontsize=40:x=7:y=680:box=1:boxcolor=black@0.8,showinfo"
file.ts

Signed-off-by: Chema Gonzalez <ch...@google.com>
---
 doc/filters.texi          | 3 ++-
 libavfilter/vf_drawtext.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 3e7d2a2..085de87 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -4930,7 +4930,8 @@ It can take up to two arguments.

 The first argument is the format of the timestamp; it defaults to @code{flt}
 for seconds as a decimal number with microsecond accuracy; @code{hms} stands
-for a formatted @var{[-]HH:MM:SS.mmm} timestamp with millisecond accuracy.
+for a formatted @var{[-]HH:MM:SS.mmm} timestamp with millisecond accuracy;
+@code{raw} stands for the raw pts value.

 The second argument is an offset added to the timestamp.

diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 16e3383..cf6a313 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -808,6 +808,8 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
     }
     if (!strcmp(fmt, "flt")) {
         av_bprintf(bp, "%.6f", s->var_values[VAR_T]);
+    } else if (!strcmp(fmt, "raw")) {
+        av_bprintf(bp, "%ld", (long int) (s->var_values[VAR_T] * 90000));
     } else if (!strcmp(fmt, "hms")) {
         if (isnan(pts)) {
             av_bprintf(bp, " ??:??:??.???");
-- 
2.5.0.457.gab17608
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to