Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
940d3cc0
Commit
940d3cc0
authored
Dec 28, 2011
by
Clément Bœsch
Committed by
Clément Bœsch
Jan 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
drawtext: fix hard dependency to lavc (timecode).
parent
e2c1d3ec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
filters.texi
doc/filters.texi
+3
-1
vf_drawtext.c
libavfilter/vf_drawtext.c
+9
-0
No files found.
doc/filters.texi
View file @
940d3cc0
...
...
@@ -1226,7 +1226,9 @@ timestamp expressed in seconds, NAN if the input timestamp is unknown
@item timecode
initial timecode representation in "hh:mm:ss[:;.]ff" format. It can be used
with or without text parameter. @var{rate} option must be specified
with or without text parameter. @var{rate} option must be specified.
Note that timecode options are @emph{not} effective if FFmpeg is build with
@code{--disable-avcodec}.
@item r, rate
frame rate (timecode only)
...
...
libavfilter/vf_drawtext.c
View file @
940d3cc0
...
...
@@ -29,6 +29,7 @@
#include <sys/time.h>
#include <time.h>
#include "config.h"
#include "libavcodec/timecode.h"
#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
...
...
@@ -341,10 +342,16 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
}
if
(
dtext
->
tc
.
str
)
{
#if CONFIG_AVCODEC
if
(
avpriv_init_smpte_timecode
(
ctx
,
&
dtext
->
tc
)
<
0
)
return
AVERROR
(
EINVAL
);
if
(
!
dtext
->
text
)
dtext
->
text
=
av_strdup
(
""
);
#else
av_log
(
ctx
,
AV_LOG_ERROR
,
"Timecode options are only available if libavfilter is built with libavcodec enabled.
\n
"
);
return
AVERROR
(
EINVAL
);
#endif
}
if
(
!
dtext
->
text
)
{
...
...
@@ -722,11 +729,13 @@ static int draw_text(AVFilterContext *ctx, AVFilterBufferRef *picref,
buf_size
*=
2
;
}
while
((
buf
=
av_realloc
(
buf
,
buf_size
)));
#if CONFIG_AVCODEC
if
(
dtext
->
tc
.
str
)
{
char
tcbuf
[
sizeof
(
"hh:mm:ss.ff"
)];
avpriv_timecode_to_string
(
tcbuf
,
&
dtext
->
tc
,
dtext
->
frame_id
++
);
buf
=
av_asprintf
(
"%s%s"
,
dtext
->
text
,
tcbuf
);
}
#endif
if
(
!
buf
)
return
AVERROR
(
ENOMEM
);
...
...
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