On 11-06-2019 04:35 AM, greg Luce wrote:
I created this issue on the bugtracker but I'm trying to format it
properly for this channel
https://trac.ffmpeg.org/ticket/7947
The actual filter change was written by Calvin Walton <calvin.wal...@kepstin.ca>
---
diff --git a/doc/filters.texi b/doc/filters.texi
index ec1c7c7591..332f4ddc80 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -8584,6 +8584,17 @@ The thickness of the drawn box.
These constants allow the @var{x}, @var{y}, @var{w}, @var{h} and
@var{t} expressions to refer to
each other, so you may for example specify @code{y=x/dar} or @code{h=w/dar}.
+@item pict_type
+A 1 character description of the current packet's input picture type.
+
+@item pkt_pos
+The current packet's position in the input datastream (in bytes from
the head of the source file)
Add a note that a value of -1 indicates this info is not available.
+
+@item pkt_duration
+The current packet's input duration
+
+@item pkt_size
+The current packet's input size (in bytes)
@end table
@@ -9032,6 +9043,14 @@ The first argument is mandatory and specifies
the metadata key.
The second argument is optional and specifies a default value, used when the
metadata key is not found or empty.
+The use of the term metadata in ffmpeg refers to extra data,
+often user-provided or generated live during decode by other filters.
Extradata in ffmpeg parlance refers primarily to codec configuration.
Metadata is typically exported as strings by the demuxer.
(Also, filters operate *after* decoding).
+If you're trying to read data from teh frames in a stream or file, run
+@code{ffprobe -show_frames}. If the information doesn't show up between
+@code{[FRAME]} and @code{[/FRAME]} in the form
@code{TAG:[metadata_key]=[metadata_value]}
+then it won't be visible to this function.
This isn't accurate. Metadata may be generated during filtering and
discarded before output. In which case, drawtext inserted after
generation can still access it but it won't show up in the input. I
believe you are trying to document that packet fields (like the three in
this patch) aren't available, unless specifically supported
Rewrite it as a positive statement.
"
Available metadata can be identified by inspecting entries starting with
TAG included within each frame section printed by running @code{ffprobe
-show_frames}.
String metadata generated in filters leading to the drawtext filter are
also available.
"
@item n, frame_num
The frame number, starting from 0.
diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
index 01cd7fa122..8f4badbdb5 100644
--- a/libavfilter/vf_drawtext.c
+++ b/libavfilter/vf_drawtext.c
@@ -88,6 +88,9 @@ static const char *const var_names[] = {
"x",
"y",
"pict_type",
+ "pkt_pos",
+ "pkt_duration",
+ "pkt_size",
NULL
};
@@ -125,6 +128,9 @@ enum var_name {
VAR_X,
VAR_Y,
VAR_PICT_TYPE,
+ VAR_PKT_POS,
+ VAR_PKT_DURATION,
+ VAR_PKT_SIZE,
VAR_VARS_NB
};
@@ -1516,6 +1522,9 @@ static int filter_frame(AVFilterLink *inlink,
AVFrame *frame)
NAN : frame->pts * av_q2d(inlink->time_base);
s->var_values[VAR_PICT_TYPE] = frame->pict_type;
+ s->var_values[VAR_PKT_POS] = frame->pkt_pos;
+ s->var_values[VAR_PKT_DURATION] = frame->pkt_duration *
av_q2d(inlink->time_base);
+ s->var_values[VAR_PKT_SIZE] = frame->pkt_size;
s->metadata = frame->metadata;
draw_text(ctx, frame, frame->width, frame->height);
---
_______________________________________________
Gyan
_______________________________________________
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".