[FFmpeg-devel] [PATCH 2/3] lavf/mkvtimestamp_v2: review implementation to match mkvextract behavior

Stefano Sabatini stefasab at gmail.com
Mon Apr 22 16:55:02 EEST 2024


On date Saturday 2024-04-20 18:47:58 +0200, Andreas Rheinhardt wrote:
> Stefano Sabatini:
[...]
> >> 1. This does not match mkvextract behaviour. mkvextract does not force a
> >> 1ms timebase.
> > 
> > From your past comment:
> >> The accuracy of the timestamps output by mkvextract is determined by the
> >> TimestampScale of the file in question; it is most often 1ms when the
> >> file has video.
> > 
> 
> "most often" != "force"
[...]

> (I am not certain wrt MKVToolNix handling of fractional millisecond; old
> versions of mkvextract may really have simply rounded/truncated to
> milliseconds.)

It doesn't, at least with version:
$ mkvextract --version
mkvextract v65.0.0 ('Too Much') 64-bit

So far, mkvextract seems to output DTSs as in the original
implementation - therefore no need to change implementation, but for
the "timecode" => "timestamp" issue.

$ ./ffprobe -hide_banner slow.mkv -of csv=nk=1:p=0 -select_streams v:0 -show_entries packet=pts  | head -n 20 
[...]
0
1201
1235
1268
1368
1301
1335
1401
1435
1535
1468
1502
1602
1568
1735
1668
1635
1702
1768
1869

$ ./ffprobe -hide_banner slow.mkv -of csv=nk=1:p=0 -select_streams v:0 -show_entries packet=dts  | head -n 20 
N/A
N/A
0
1201
1235
1268
1301
1335
1368
1401
1435
1468
1502
1535
1568
1602
1635
1668
1702
1735

$ mkvextract slow.mkv timestamps_v2 0:slow.mkv.out
Progress: 100%
$ head -n 21 slow.mkv.out 
# timestamp format v2
0
1201
1235
1268
1301
1335
1368
1401
1435
1468
1502
1535
1568
1602
1635
1668
1702
1735
1768
1802


More information about the ffmpeg-devel mailing list