Zend certified PHP/Magento developer

Merge and copy 2 audio tracks from video file

I have a video file with 2 audio tracks. I wish to utilize a single ffmpeg operation to have a video with:

  1. Merged audio
  2. Audio #1
  3. Audio #2

With this I can merge the audios, ending up with video with a single merged audio track:

ffmpeg -i "myvideo-with-2-audio-tracks.mkv" -c:v copy -c:a aac -ac 2 -filter_complex amerge=inputs=2 "myvideo-with-1-merged-audio-track.mkv"

I can use a second command to combine everything, but this requires processing twice. If I add -c:a copy to the end, I get an error:

Streamcopy requested for output stream fed from a complex filtergraph.
Filtering and streamcopy cannot be used together