[FFmpeg-user] Problem with concatenating converted mkv files with changed sample rate

Mike Martin redtux1 at gmail.com
Fri Jul 16 15:05:42 EEST 2021


Hi
I have come across a strange issue with concatenating mkv  (vp9/libopus)
files  which have been transcoded from mp4 and the saple rate changed.

Conversion string
ffmpeg -v 35 -threads 4 -i
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_1_envsc2_1_envs_vo.mkv
-c:v libvpx-vp9 -crf 40 -row-mt 1 -tile-columns 6 -frame-parallel 1 -c:a
libopus -b:a 56k -ar 48000 -frame_size 40 -strict -2 -ac 2 -af
aresample=48000,volume=1 -vf
scale='480:trunc(ow/((1/sar)*dar)/2)*2',setsar='1/1',fps='fps=20' -y -speed
15 -deadline realtime
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_1_envsc2_1_envs_vo_envs_vo.mkv

This seems to go normally, however when I then try to concatenate these
files I get a short video, eg 47 minutes rather than 2:24

The error is
[matroska @ 0x56489ea616c0] Non-monotonous DTS in output stream 0:1;
previous: 2855081, current: 2855000; changing to 2855081. This may result
in incorrect timestamps in the output file.
[concat @ 0x56489e998980] DTS 2855014 < 2855064 out of order
[matroska @ 0x56489ea616c0] Application provided invalid, non monotonically
increasing dts to muxer in stream 0: 2855064 >= 2855014
Conversion failed!

concat file is

file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_1_envsc2_1_envs_vo.mkv
duration 0:23:21
file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_2_envsc2_1_envs_vo.mkv
duration 0:24:14
file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_3_envsc2_1_envs_vo.mkv
duration 0:24:04
file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_4_envsc2_1_envs_vo.mkv
duration 0:23:38
file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_5_envsc2_1_envs_vo.mkv
duration 0:24:00
file
/srv/data/staging/Doctor_Who_10_3_Frontier_in_Space_6c2_envsc2_1_envs_vo.mkv
duration 0:24:46

If I convert to mp4 with aac no issues, but I cant convert the resulting
file to mkv vp9/libopus with the same issues.

Anyone any ideas what is happening?


More information about the ffmpeg-user mailing list