I try to concatenate multiple videos to achieve the following:
- All my videos are in mp4 format.
- One video is first slowed down, then mixed with audio
- Videos are concatenated in the following order: Normal video, normal video, slowed-down video (output.mp4), normal video ...
The video is slowed down with the following command:
ffmpeg -y -i raw.mp4 -filter:v 'setpts=1.3333*PTS' silent.mp4
Audio is added with the following command:
ffmpeg -y -i silent.mp4 -i audio.mp3 -map 0:0 -map 1:0 output.mp4
When I concatenate using the Concat demuxer (https://trac.ffmpeg.org/wiki/Concatenate) the audio of the output is not in sync with the video. During the concatenation I get the "Non-monotonous DTS" error.
I tried the following
Following this suggestion (https://video.stackexchange.com/a/22941/24238) after I created my slowed down and mixed video (output.mp4) I convert all mp4 videos to mts format. After this I concatenate and with
ffmpeg -i fullvideo.mts fullvideo.mp4
I convert the resulting video back to mp4 format. This video plays just fine, but during the convert again I get the following error "Non-monotonous DTS in output stream 0:1; previous: 191803, current: 187633; changing to 191804. This may result in incorrect timestamps in the output file."
Even regardless the error the video plays just fine, even in the browser. Does this solution still have a disadvantage or threat? Is there a better solution where I don't get any DTS error?
I am thankful for any help as this is all new for me.