Split audio and video into two separate files
ffmpeg supports demuxing without re-encoding:

ffmpeg -i input.mkv # show stream numbers and formats
ffmpeg -i input.mkv -c copy audio.m4a # AAC
ffmpeg -i input.mkv -c copy audio.mp3 # MP3
ffmpeg -i input.mkv -c copy audio.ac3 # AC3
ffmpeg -i input.mkv -an -c copy video.mkv
ffmpeg -i input.mkv -map 0:a:1 -c copy audio.m4a # stream 1


-c copy is like -vcodec copy -acodec copy. -map 0:1 means file 0, stream 1. -an means audio none.

-- Edited: -map 0:1 => -map 0:a:1 (pick 2nd audio not just 2nd any stream)