@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)
#include <sys/time.h>
#include <time.h>
+#include "config.h"
#include "libavcodec/timecode.h"
#include "libavutil/avstring.h"
#include "libavutil/colorspace.h"
}
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) {
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);