ffmpeg changes stream order from input to output

Description

Summary of the bug:

I'm extracting some fragments from an mpeg file, to join them afterwards.

The problem is that ffmpeg sometimes changes the order of the audio and video streams (video was the first stream and, sometimes, the file produced by ffmeg has audio as the first stream), and this makes more difficult to join the files, because of this: