orcanode icon indicating copy to clipboard operation
orcanode copied to clipboard

FLAC filenames or metadata should provide start time precision greater than seconds

Open scottveirs opened this issue 7 years ago • 4 comments

For both localization of underwater sound and accurate annotation of the audio data, it would be ideal to have more than 1-second precision when indicating the start time of a FLAC file. Can ffmpeg add precision (say up to milliseconds, or ideally microseconds) when generating the filename?

scottveirs avatar Oct 18 '18 15:10 scottveirs

Left a comment in slack on this. But basically NTP means the inherent accuracy of the node is in 10's of milliseconds. It might be possible to add GPS to get that accuracy down to microseconds. But then you have to figure out what the error put in my ffmpeg. I have some ideas on how to measure that if you have a GPS time (since you have PPS to syncronize off of).

mcshicks avatar Sep 14 '21 18:09 mcshicks

A bit more of investigation. We use strftime to format our timestamps, that doesn't support milliseconds. But someone has patched it. https://github.com/InSoundz/ffmpeg-strftime-milliseconds. So we would be back build to building our own ffmpeg to get this.

mcshicks avatar Sep 14 '21 18:09 mcshicks

So I looked at it some more. That patch no longer builds, there is a C struct called AVFormatContext defined in libavformat/avformat.h that's definition has changed. There is a single file libavformat/segment.c which is building these filenames. There is appears to be a single call to strftime in that file which is replaced by a new strftime_millis so probably simpler to try and write a new patch on top of the current baseline.

mcshicks avatar Sep 21 '21 19:09 mcshicks

Possibly helpful:

https://github.com/InSoundz/ffmpeg-strftime-milliseconds

scottveirs avatar Apr 25 '23 17:04 scottveirs