I was trying the same thing as this with two mkv, with the video from the first file and all the audio tracks and subtitles from the second file:
ffmpeg -i 1.mkv -i 2.mkv -map 0:v -map 1:a -map 1:s -c:v copy -c:a copy -c:s copy -shortest out.mkv
but it's not working, in output I have a file whith broken audio track, if I run it with VLC it seems ok until I skip forward or change audio track, everything I do will stop executing the audio track.
If I run VLC from terminal for some verbosity I obtain:
core decoder error: buffer deadlock prevented
Any idea?
-------Edit-------------------------------
I think the problem was with the subs, if I remove the subs everything works good. Is it possible that the "-shortest" option broke something because of the length of the subs?