[FFmpeg-devel] [PATCH] Fix loss of precision for silencedetecton large files

Tobias Rapp t.rapp at noa-archive.com
Thu Mar 28 09:45:24 EET 2019


On 27.03.2019 23:13, Allan Cady via ffmpeg-devel wrote:
>   On Tue, Mar 26, 2019 at 10:07:10PM +0000, Allan Cady via ffmpeg-devel wrote:
> 
>> When the silencedetect filter is run against very large files, the
>> output timestamps gradually lose precision as the scan proceeds
>> further into the file. This is because the output is formatted (in
>> libavutil/timestamp.h) as "%.6g", which limits the total field length.
>> Eventually, for offsets greater than 100000 seconds (about 28 hours),
>> fractions of a second disappear altogether, and the timestamps
>> are logged as whole integers. This is insufficient precision for
>> my purposes.
>>
>> I propose changing the format to "%.3f", which will give millisecond
>> precision for all timestamps regardless of offset.

I think it would be nice if some of this description would be included 
into the patch commit message. The header line is misleading in focusing 
on silencedetect when the change is actually done in (a)metadata filter.

Also usual commit header line convention is to start with the affected 
module (like "avutil/timestamp: ...").

> First glance it looks like there are pre-built reference output files in the tests that may need to be re-generated, and that may be all that's required. I'll continue digging to try to understand what's going on.

You might want to look into "make fate GEN=1". See 
http://ffmpeg.org/fate.html#FATE-makefile-targets-and-variables for details.

Regards,
Tobias



More information about the ffmpeg-devel mailing list