This is everything I know to do in ffmpeg.

Adding a subtitle track from an external source:

ffmpeg -i infile.mp4 -i infile.srt -c copy -c:s mov_text outfile.mp4

Burning subtitles into a video from an external source:

ffmpeg -i video.avi -vf subtitles=subtitle.srt out.avi

Burning subtitles into a video from the subtitle track:

ffmpeg -i video.mkv -vf subtitles=video.mkv out.avi

Extracting a subtitle track to a subtitle file:

ffmpeg -txt_format text -i input_file.mkv out.srt