[FFmpeg-devel] [PATCH] Add support for drawing PTS in HHMMSSms format to vf_drawtext

hjiodjf 97xgw46 jfbvxt at gmail.com
Thu Apr 24 22:00:04 CEST 2014


On Thu, Mar 27, 2014 at 11:30 AM, Nicolas George <george at nsup.org> wrote:
> Is it not possible to get a correct identity? For authorship and copyright
> tracking, this is much more useful.
>

Unfortunately, no.

>> Date: Wed, 19 Mar 2014 13:26:11 -0700
>> Subject: [PATCH 2/2] Add support for drawing wall clock timestamps to
>>  vf_drawtext.
>>
>> ---
>
>>  libavfilter/vf_drawtext.c | 38 ++++++++++++++++++++++++++++++++++++--
>>  1 file changed, 36 insertions(+), 2 deletions(-)
>
> You forgot to update the documentation.
>

I've updated doc/filters.texi in my latest patch.

>>
>> diff --git a/libavfilter/vf_drawtext.c b/libavfilter/vf_drawtext.c
>> index 1690b38..f50848d 100644
>> --- a/libavfilter/vf_drawtext.c
>> +++ b/libavfilter/vf_drawtext.c
>> @@ -57,6 +57,8 @@
>>  #include <fontconfig/fontconfig.h>
>>  #endif
>>
>
>> + #define HUNDRED_NS ((int64_t)10000000)
>
> Can you explain why you work with that strange unit instead of just plain
> milliseconds?
>

I've switched to plain milliseconds.

> The place where you added the expansion, the place that handles the SMPTE
> formatting, is an old ad-hoc implementation. A more powerful expansion
> scheme was implemented later: see the expand_text() function and the
> drawtext_function structure for dispatch. I believe new features would be
> better in that framework than imitating the old SMPTE code.
>
> (In fact, I believe someone should probably update the SMPTE to fit the new
> expansion mechanism. But I may be missing something.)
>
>>          char tcbuf[AV_TIMECODE_STR_SIZE];
>>          av_timecode_make_string(&s->tc, tcbuf, inlink->frame_count);
>>          av_bprint_clear(bp);
>
> Regards,
>
> --
>   Nicolas George

Thank you for pointing this out. I've simplified my patch and
converted it to use an expansion function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-support-for-drawing-wall-clock-timestamps-to-vf_.patch
Type: application/octet-stream
Size: 2220 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140424/c9c5e588/attachment.obj>


More information about the ffmpeg-devel mailing list