ffmpeg/doc
Marton Balint 5df901ffa5 avutil/timestamp: introduce av_ts_make_time_string2 for better precision
av_ts_make_time_string() used "%.6g" format, but this format was losing
precision even when the timestamp to be printed was not that large. For example
for 3 hours (10800) seconds, only 1 decimal digit was printed, which made this
format inaccurate when it was used in e.g. the silencedetect filter. Other
detection filters printing timestamps had similar issues. Also time base
parameter of the function was *AVRational instead of AVRational.

Resolve these problems by introducing a new function, av_ts_make_time_string2().

We change the used format to "%.*f", use a precision of 6, except when printing
values near 0, in which case we calculate the precision dynamically to aim for
a similar precision in normal form as with %.6g.  No longer using scientific
representation can make parsing the timestamp easier for the users, we can
safely do this because the theoretical maximum of INT64_MAX*INT32_MAX still
fits into the string buffer in normal form.

We somewhat imitate %g by trimming ending zeroes and the potential decimal
point characters. In order not to trim "inf" as well, we assume that the
decimal point string does not contain the letter "f". Note that depending on
printf %f implementation, we might trim "infinity" to "inf".

Thanks for Allan Cady for bringing up this issue.

Signed-off-by: Marton Balint <cus@passwd.hu>
2024-03-25 21:30:51 +01:00
..
doxy
examples doc/examples/qsv_decode: remove unused config.h header file 2024-03-12 11:26:06 +01:00
.gitignore
APIchanges avutil/timestamp: introduce av_ts_make_time_string2 for better precision 2024-03-25 21:30:51 +01:00
Doxyfile
Makefile
authors.texi
bitstream_filters.texi doc/bitstream_filters.texi: Document types used by filter_units 2024-03-10 17:49:16 +01:00
bootstrap.min.css doc/html: fix styling issue with Texinfo 7.0 2023-11-08 23:54:23 +01:00
build_system.txt
codecs.texi doc/codecs: add missing comma to introduction 2024-01-04 01:10:25 +01:00
community.texi doc/community: improve wording 2023-11-08 17:01:50 +01:00
decoders.texi avcodec/evc_decoder: Provided support for EVC decoder 2023-11-20 11:55:51 -03:00
default.css
demuxers.texi avformat/dvdvideodec: add menu demuxing support 2024-03-12 11:14:16 +01:00
developer.texi Require compilers to support C11. 2024-02-18 07:38:28 +01:00
devices.texi
doxy-wrapper.sh
encoders.texi lavc/vaapi_encode: Enable block level bitrate control 2024-03-18 12:00:14 +08:00
errno.txt
faq.texi doc/faq: use texi's @tie instead of 0xA0 for non-breaking space 2024-01-10 19:52:23 +01:00
fate.texi doc/fate: advise on --assert-level=2 2024-03-19 04:10:48 +01:00
fate_config.sh.template fate: Allow running multiple rounds of tests with differing settings 2023-12-19 13:34:25 +02:00
ffmpeg-bitstream-filters.texi
ffmpeg-codecs.texi
ffmpeg-devices.texi
ffmpeg-filters.texi
ffmpeg-formats.texi
ffmpeg-protocols.texi
ffmpeg-resampler.texi
ffmpeg-scaler.texi
ffmpeg-utils.texi
ffmpeg.texi fftools/ffmpeg: add loopback decoding 2024-03-13 08:01:27 +01:00
ffmpeg.txt
ffplay.texi fftools/ffplay: add hwaccel decoding support 2023-11-15 01:20:11 +08:00
ffprobe.texi fftools/ffprobe: add support for Stream Groups 2024-03-05 12:56:21 -03:00
ffprobe.xsd fftools/ffprobe: export IAMF Stream Group parameters 2024-03-13 16:45:15 -03:00
fftools-common-opts.texi fftools/cmdutils: add option syntax for loading arbitrary arguments from a file 2024-01-20 10:23:24 +01:00
filter_design.txt
filters.texi doc/filters: extend af_channelmap documentation 2024-03-24 21:27:55 +01:00
formats.texi doc/formats: clarify meaning of igndts as per definition in avformat.h 2024-02-07 00:55:40 +01:00
general.texi
general_contents.texi lavc/dxvenc: add DXV encoder with support for DXT1 texture format 2024-01-23 21:31:22 +01:00
git-howto.texi doc/git-howto: use less weird username for git URL 2023-11-22 10:21:50 +01:00
indevs.texi lavd: deprecate the bktr device 2024-02-02 15:40:35 +01:00
infra.txt doc: Add infra.txt 2024-02-24 15:05:19 +01:00
issue_tracker.txt
lexicon
libav-merge.txt
libavcodec.texi
libavdevice.texi
libavfilter.texi
libavformat.texi
libavutil.texi
libswresample.texi
libswscale.texi
mailing-list-faq.texi
metadata.texi doc/muxers: add ffmetadata 2024-03-18 17:59:19 +01:00
mips.txt avcodec: Remove DCT, FFT, MDCT and RDFT 2023-10-01 02:25:09 +02:00
multithreading.txt avcodec/pthread_frame: Remove ff_thread_release_buffer() 2023-10-22 22:09:59 +02:00
muxers.texi doc/muxers: add hds 2024-03-23 11:42:13 +01:00
nut.texi
optimization.txt
outdevs.texi avdevice: deprecate sdl outdev 2024-02-28 10:28:49 +01:00
patchwork
platform.texi
print_options.c
protocols.texi avformat/rtmpproto: support enhanced rtmp 2023-09-05 09:14:18 +08:00
rate_distortion.txt
resampler.texi
scaler.texi
snow.txt
style.min.css
swresample.txt
swscale.txt
t2h.init
t2h.pm doc/html: support texinfo 7.0 2023-11-08 23:53:19 +01:00
tablegen.txt
texi2pod.pl
texidep.pl
transforms.md
undefined.txt
utils.texi doc/utils: fix atan2 parameter order 2024-01-16 01:07:51 +01:00
writing_filters.txt