[FFmpeg-devel] burn-in timestamp and pts:localtime:offset
Nicolas George
george at nsup.org
Mon Oct 10 17:47:56 EEST 2016
Le nonidi 19 vendémiaire, an CCXXV, Patrick Fischer a écrit :
> What do you think, will this be a good enhancement??
Have you tried use_wallclock_as_timestamps?
> --- FFmpeg-release-3.0_orig/libavfilter/vf_drawtext.c 2016-09-05
> 02:13:28.000000000 +0200
> +++ FFmpeg-release-3.0/libavfilter/vf_drawtext.c 2016-09-22
> 10:22:55.625648763 +0200
Please use git format-patch or git send-email for patches, and beware bogus
MUAs that rewrap lines they should not.
> @@ -791,6 +791,7 @@
> return 0;
> }
>
> +static int64_t delta = 0;
Static variables are not acceptable in libraries.
> static int func_pts(AVFilterContext *ctx, AVBPrint *bp,
> char *fct, unsigned argc, char **argv, int tag)
> {
> @@ -801,10 +802,13 @@
>
> fmt = argc >= 1 ? argv[0] : "flt";
> if (argc >= 2) {
> - int64_t delta;
> - if ((ret = av_parse_time(&delta, argv[1], 1)) < 0) {
> - av_log(ctx, AV_LOG_ERROR, "Invalid delta '%s'\n", argv[1]);
> - return ret;
> + if (0 == delta) {
> + if (!strcmp(argv[1], "now")) {
> + delta = time(NULL)*1000000;
> + } else if ((ret = av_parse_time(&delta, argv[1], 1)) < 0) {
> + av_log(ctx, AV_LOG_ERROR, "Invalid delta '%s'\n", argv[1]);
> + return ret;
> + }
> }
> pts += (double)delta / AV_TIME_BASE;
> }
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161010/2c1c9747/attachment.sig>
More information about the ffmpeg-devel
mailing list