title: Extracting text subtitles using ffmpeg libraries
body: <p>I'm writing a C program that uses the ffmpeg's libav* libs, and using <a href="http://dranger.com/ffmpeg/" rel="noreferrer">Dranger's tutorial</a>, I can decode both audio and video correctly. Currently, I'm trying to extract subtitles. I actually don't want to decode them on time and display them on the video, but actually extract the subtitle text out of the container.</p>
  
  <p>For example, on the cli,</p>
  
  <pre><code>ffmpeg -i video.mkv -map 0:4 -scodec copy out.ass
  </code></pre>
  
  <p>would give me the ass file back. (For some reason, srts only return the text.)</p>
  
  <p>I've tried messing with AVSubtitle, avcodec_decode_subtitle2, etc., but they're returning the subtitles line by line. I would like the timecodes in srts, header information in ass, etc. All I want is the entire subtitle text file that was muxed into the container.</p>