[FFmpeg-user] failed to compile with av_ts2timestr

Diederick C. Niehorster dcnieho at gmail.com
Sun May 29 09:36:28 EEST 2022


On Sun, May 29, 2022 at 4:04 AM Bang He <hezhanbang at gmail.com> wrote:
>
> my application code will call some ffmpeg api.
>
> here is my code which call ffmpeg api:
> printf("pts %s\n", av_ts2timestr(packet.pts, stream->time_base));
>
> error when compiled:
> ffmpeg/include/libavutil/timestamp.h:76:83: error: taking address of
> temporary array
>  #define av_ts2timestr(ts, tb)
> av_ts_make_time_string((char[AV_TS_MAX_STRING_SIZE]){0}, ts, tb)
>
> what should i do?

use av_ts_make_time_string yourself instead, the construct in that
marco is illegal in C++


More information about the ffmpeg-user mailing list