4 ms·
Unfortunately most digital video formats don’t actually store them this way, either because the editing software rounds it off incorrectly or because the format
by astrange 4y ago
Unfortunately most digital video formats don’t actually store them this way, either because the editing software rounds it off incorrectly or because the format itself stores timestamps in decimals for some reason (Matroska).
- mgdlbp 4y ago<rant>Ah...Matroska was nearly perfect, and then they chose nanosecond-precision timestamps. Countless attempts at frame-perfect seeking thwarted and videos imbued with jitter over the years, subordinate to the tyranny of 33 34 33 33 34 33... Even worse, not only is the recommended precision only 1 ms, but almost all muxers support nothing else, ffmpeg included*. A shame that despite such versatility, mkv is scuffed as an intermediate/archival format by lossy muxing, yet almost no one is aware. * https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-May/280460.html https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-May/280... matroska precision parameter coming soon? It's been over a year, though - looks like the patch is dead. Meanwhile, the bikeshedding of rational timestamps in the matroska lists can now be expressed with a timebase of decades....
- iforgotpassword 4y agoNot that I know much more than how to merge multiple audio tracks into a single file and do the Faststart stuff so the video starts faster, isn't the issue then really only that everyone only does milliseconds with mkv, and theoretical otherwise? Surely, when using nanoseconds and just moving the error to the next frame, jitter should be unperceivable, not even measurable on even high refresh rate displays?
- astrange 4y agoThere most likely aren't playback issues; it's just silly that a concept that is never anything but a rational number is being stored in a way that can't store rational numbers.
- Dylan16807 4y agoExact timestamps are aesthetically nice but frame-perfect seek should not have any problems with sub-millisecond jitter.
- mgdlbp 4y agoWhen you seek to a timestamp from the source, or write a temporary matroska file and go over it in parallel in a second pass, timestamps being rounded variously up or down will cause off-by-ones and dropped frames and desyncs. 1 ms is pretty imprecise for audio seeks, however - mkvtoolnix actually increases precision to sample rate when there's audio. But why do all tracks have the same timescale? Oh right, TrackTimeStampScale was in the spec all along and could be used to solve all of this...apart from being floating-point.
- Dylan16807 4y ago> When you seek to a timestamp from the source, or write a temporary matroska file and go over it in parallel in a second pass, timestamps being rounded variously up or down will cause off-by-ones and dropped frames and desyncs. Why? It shouldn't. A millisecond-resolution timestamp unambiguously identifies a specific frame, at least until you start going over 400fps. You just need to go to the closest frame rather than rounding up/down. And rounding up/down can break very easily even if you're using ultra precise numbers, especially if you don't have a fixed framerate for the entire file.
- Const-me 4y agoMany multimedia formats, frameworks and libraries actually store them that way. In Mpeg 4, each track header has a “time scale” integer field. For a video track of 23.976 FPS the value can be 23976, or half of that, 11988. Audio tracks typically have different time scale field, often 48000 for 48kHz audio. In Media Foundation, MF_MT_FRAME_RATE media type attribute is a rational number with uint32_t numerator and denominator. In DXGI, the RefreshRate field of DXGI_MODE_DESC structure which contains a refresh rate of a monitor is a rational number, for instance my display actually uses 59997/1000 Hz frame rate, not exactly 60 Hz.
- anderskaseorg 4y agoI think part of the parent’s complaint is that, although 23976/1000 fps is much more accurate than 24 fps, it’s still very slightly slower than the correct value 24000/1001 fps, by about 2.1 frames per day.
- Const-me 4y agoMpeg-4 can do that just fine. Here’s what MediaInfo tool shows about the video stream of some *.mp4 file on my computer. The content was first released in 1997, before modern digital stuff. Frame rate mode: Constant Frame rate: 23.976 (24000/1001) FPS Specifically, the timescale value in "mdhd" box (overall information about the media, defined in section 8.4.2 of the ISO/IEC 14496-12 spec) is 24000, and "stts" box (time-to-sample, defined in section 8.6.1.2 of that spec) says all video frames have the same sampleDelta = 1001.