Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
eb87b340
Commit
eb87b340
authored
Nov 22, 2012
by
Stefano Sabatini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/drawtext: add support for printing frame numbers
Fix trac ticket #1949.
parent
dcbf7283
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
filters.texi
doc/filters.texi
+3
-0
version.h
libavfilter/version.h
+1
-1
vf_drawtext.c
libavfilter/vf_drawtext.c
+11
-0
No files found.
doc/filters.texi
View file @
eb87b340
...
@@ -2083,6 +2083,9 @@ It can accept an argument: a strftime() format string.
...
@@ -2083,6 +2083,9 @@ It can accept an argument: a strftime() format string.
The time at which the filter is running, expressed in the local time zone.
The time at which the filter is running, expressed in the local time zone.
It can accept an argument: a strftime() format string.
It can accept an argument: a strftime() format string.
@item n, frame_num
The frame number, starting from 0.
@item pts
@item pts
The timestamp of the current frame, in seconds, with microsecond accuracy.
The timestamp of the current frame, in seconds, with microsecond accuracy.
...
...
libavfilter/version.h
View file @
eb87b340
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 23
#define LIBAVFILTER_VERSION_MINOR 23
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_drawtext.c
View file @
eb87b340
...
@@ -611,6 +611,15 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
...
@@ -611,6 +611,15 @@ static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
return
0
;
return
0
;
}
}
static
int
func_frame_num
(
AVFilterContext
*
ctx
,
AVBPrint
*
bp
,
char
*
fct
,
unsigned
argc
,
char
**
argv
,
int
tag
)
{
DrawTextContext
*
dtext
=
ctx
->
priv
;
av_bprintf
(
bp
,
"%d"
,
(
int
)
dtext
->
var_values
[
VAR_N
]);
return
0
;
}
#if !HAVE_LOCALTIME_R
#if !HAVE_LOCALTIME_R
static
void
localtime_r
(
const
time_t
*
t
,
struct
tm
*
tm
)
static
void
localtime_r
(
const
time_t
*
t
,
struct
tm
*
tm
)
{
{
...
@@ -643,6 +652,8 @@ static const struct drawtext_function {
...
@@ -643,6 +652,8 @@ static const struct drawtext_function {
{
"pts"
,
0
,
0
,
0
,
func_pts
},
{
"pts"
,
0
,
0
,
0
,
func_pts
},
{
"gmtime"
,
0
,
1
,
'G'
,
func_strftime
},
{
"gmtime"
,
0
,
1
,
'G'
,
func_strftime
},
{
"localtime"
,
0
,
1
,
'L'
,
func_strftime
},
{
"localtime"
,
0
,
1
,
'L'
,
func_strftime
},
{
"frame_num"
,
0
,
0
,
0
,
func_frame_num
},
{
"n"
,
0
,
0
,
0
,
func_frame_num
},
};
};
static
int
eval_function
(
AVFilterContext
*
ctx
,
AVBPrint
*
bp
,
char
*
fct
,
static
int
eval_function
(
AVFilterContext
*
ctx
,
AVBPrint
*
bp
,
char
*
fct
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment