Warnings flood when remuxing MKV to MOV or MP4 [issue]

This refers to 4.2.0.

I switched to h.264/AAC.MKV, because MKV is the only container format which allows preview with external media players while rendering (currently), which is a vital feature for me. MKV isn’t a well supported container in the NLE world, so remuxing MKV to MOV or MP4 is more or less mandatory if the clips are supposed to be used for video editing. After having processed over 400 clips, I found that when remuxing with ffmpeg almost any MKV clips created with VAI throw a flood of warnings of this kind:

The sentence about potentially incorrect timestamps concerns me most (and presumably all others who see it, as well). In my view, this needs clarification for all use cases (frame rates, input formats, VAI models…) from Topazlabs!

As far as I know MKV doesn’t carry DTS, i.e. the muxer has to calculate/guess the values, if the target container needs DTS (most do). My best guess is that there is something wrong with the time base used by VAI, which causes minor rounding errors and thus the warning when remuxing, consequently it shouldn’t have noticeable impact to PTS or decoding order (which would be fatal) , but I’m by no means sure that I’m right.

To reproduce the issue, download the source clip from here and remux it to MOV using something like this:

You will see no warnings and no errors. When converting it with something like this.

You will see no warnings, no errors, but two duplicate frames at the very beginning, presumably to compensate for audio stream delay. Pretty normal for a sane input file of strictly constant frame rate. So far, so good.

Now comes the issue: Download the processed file from here ( (export settings see below). Remux it to mov and you will see a flood of warnings. Convert it to mp4 and, beside of the flood of warnings, you will see in total 41 duplicate frames created at apparently random positions.

Please note: My tests show that the DTS warnings are definitely not caused by enabled frame interpolation, but it is more than likely that frame interpolation causes unexpected duplicate frames, as already reported elsewhere.

Export settings:

image
image
image

Back on this with additional information.

I tried if it’s possible to get rid of the warnings by assigning a new time base to the MKV file created by VAI, not by re-encoding, but by remuxing in a two step process, like so (cmd.exe syntax):

ffmpeg -i "%~1" -c copy -f h264 "%folder%\%~n1".h264
ffmpeg -i "%folder%\%~n1".h264 -i "%~1" -c copy -video_track_timescale 90000 -map 0 -map 1:a "%folder%\%~n1-tbn90k".mkv

The conversion failed throwing this message block:

[matroska @ 000001e8e8604d40] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[matroska @ 000001e8e8604d40] Can't write packet with unknown timestamp
[aost#0:1/copy @ 000001e8e78bff80] Error submitting a packet to the muxer: Invalid argument
[out#0/matroska @ 000001e8e795eac0] Error muxing a packet
[out#0/matroska @ 000001e8e795eac0] video:2kB audio:1kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
size=       2kB time=00:00:00.06 bitrate= 219.1kbits/s speed= 6.6x
Conversion failed!

It seems that some time stamps in the MKV file created by VAI are unset or invalid, at least that’s what ffmpeg seems to see.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.