Suppose TS has the following program streams:
Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 30 fps, 30 tbr, 90k tbn, 60 tbc
Stream #0:1[0x200]: Audio: aac (LC) ([17][0][0][0] / 0x0011), 44100 Hz, stereo, fltp, 143 kb/s
Extract video from TS from stream #0:0:
ffmpeg -i x.ts -map 0:0 -vcodec copy x.mp4
Extract audio from TS from stream #0:1:
ffmpeg -i x.ts -map 0:1 -acodec copy x.aac
Convert transport stream file to MPEG-4 format:
ffmpeg -i file.ts -c:v copy -c:a aac -strict -2 file.mp4