Changes to vf_drawtext.c written by Calvin Walton <calvin.walton@kepstin.ca> Changes to filters.texi written by greg Luce <electron.rotoscope@gmail.com> with lots of help from Moritz Barsnick and Gyan Fixes #7947.
Unified · Split
| @@ -9002,6 +9002,17 @@ to each other, so you can for example specify @code{y=x/dar}. · 9001 unmodified lines | |||
| 9002 | 9002 | ||
| 9003 | @item pict_type | 9003 | @item pict_type |
| 9004 | A one character description of the current frame's picture type. | 9004 | A one character description of the current frame's picture type. |
| 9005 | |||
| 9006 | @item pkt_pos | ||
| 9007 | The current packet's position in the input file or stream | ||
| 9008 | (in bytes, from the start of the input). A value of -1 indicates | ||
| 9009 | this info is not available. | ||
| 9010 | |||
| 9011 | @item pkt_duration | ||
| 9012 | The current packet's duration, in seconds. | ||
| 9013 | |||
| 9014 | @item pkt_size | ||
| 9015 | The current packet's size (in bytes). | ||
| 9005 | @end table | 9016 | @end table |
| 9006 | 9017 | ||
| 9007 | @anchor{drawtext_expansion} | 9018 | @anchor{drawtext_expansion} |
| @@ -31,7 +31,8 @@ · 30 unmodified lines | |||
| 31 | 31 | ||
| 32 | #define LIBAVFILTER_VERSION_MAJOR 7 | 32 | #define LIBAVFILTER_VERSION_MAJOR 7 |
| 33 | #define LIBAVFILTER_VERSION_MINOR 56 | 33 | #define LIBAVFILTER_VERSION_MINOR 56 |
| 34 | #define LIBAVFILTER_VERSION_MICRO 100 | 34 | #define LIBAVFILTER_VERSION_MICRO 101 |
| 35 | |||
| 35 | 36 | ||
| 36 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ | 37 | #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ |
| 37 | LIBAVFILTER_VERSION_MINOR, \ | 38 | LIBAVFILTER_VERSION_MINOR, \ |
| @@ -88,6 +88,9 @@ static const char *const var_names[] = { · 87 unmodified lines | |||
| 88 | "x", | 88 | "x", |
| 89 | "y", | 89 | "y", |
| 90 | "pict_type", | 90 | "pict_type", |
| 91 | "pkt_pos", | ||
| 92 | "pkt_duration", | ||
| 93 | "pkt_size", | ||
| 91 | NULL | 94 | NULL |
| 92 | }; | 95 | }; |
| 93 | 96 | ||
| @@ -125,6 +128,9 @@ enum var_name { · 31 unmodified lines | |||
| 125 | VAR_X, | 128 | VAR_X, |
| 126 | VAR_Y, | 129 | VAR_Y, |
| 127 | VAR_PICT_TYPE, | 130 | VAR_PICT_TYPE, |
| 131 | VAR_PKT_POS, | ||
| 132 | VAR_PKT_DURATION, | ||
| 133 | VAR_PKT_SIZE, | ||
| 128 | VAR_VARS_NB | 134 | VAR_VARS_NB |
| 129 | }; | 135 | }; |
| 130 | 136 | ||
| @@ -1516,6 +1522,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *frame) · 1385 unmodified lines | |||
| 1516 | NAN : frame->pts * av_q2d(inlink->time_base); | 1522 | NAN : frame->pts * av_q2d(inlink->time_base); |
| 1517 | 1523 | ||
| 1518 | s->var_values[VAR_PICT_TYPE] = frame->pict_type; | 1524 | s->var_values[VAR_PICT_TYPE] = frame->pict_type; |
| 1525 | s->var_values[VAR_PKT_POS] = frame->pkt_pos; | ||
| 1526 | s->var_values[VAR_PKT_DURATION] = frame->pkt_duration * av_q2d(inlink->time_base); | ||
| 1527 | s->var_values[VAR_PKT_SIZE] = frame->pkt_size; | ||
| 1519 | s->metadata = frame->metadata; | 1528 | s->metadata = frame->metadata; |
| 1520 | 1529 | ||
| 1521 | draw_text(ctx, frame, frame->width, frame->height); | 1530 | draw_text(ctx, frame, frame->width, frame->height); |