Concatenating AVI files with multiple tracks
Basically what you need to do is demultiplex each file, then concatenate the resulting files. There is a way to do this with the concat filter, but it requires re-encoding everything as it goes.

So you need to do two operations. First, demultiplex. (Note this is untested with ffmpeg, as I don't have any video files to test with, but should theoretically work.)

I=0;J=1;for f in $PWD/*.avi;do ffmpeg -i "$f" -map 0:v:0 -codec copy output$I.avi -map 0:v:1 -codec copy output$J.avi &amp;&amp; I=$(($I+1)) &amp;&amp; J=$(($J+1));done


Then you can use the concat demuxer as usual:

ffmpeg -f concat -i &lt;(for f in $PWD/*.avi;do echo "file '$f'";done) -c copy output.avi