title: How to use gstreamer to overlay video with subtitles
body: <p>This question is related to <a href="https://stackoverflow.com/questions/26465983/how-to-add-subtitles-from-a-srt-file-on-a-video-and-play-it-with-gstreamer-in-a">How to add subtitles from a SRT file on a video and play it with Gstreamer in a c program</a></p>
  
  <p>I want to overlay an MP4 video with subtitles from an SRT file.</p>
  
  <p>It seems to me that this process requires two threads: one to read and decode the MP4 file and another to read and parse the subtitles.  Then they need to be combined somehow, which is what I think the element <code>subtitleoverlay</code> is for.  Last, I want to view the result.  (When this works, I will re-write this in Python and install it behind a web-server that will and overlay video content with custom subtitles and stream the result.)</p>
  
  <p>Here is my first attempt:</p>
  
  <pre><code>gst-launch-1.0 -v \
    filesrc location=titles.srt \
    ! subparse name=txt \
    ! queue \
    ! filesrc location=sample.mp4 \
    ! decodebin \
    ! subtitleoverlay \
    ! autovideosink
  </code></pre>
  
  <p>This prints:</p>
  
  <pre><code>WARNING: erroneous pipeline: could not link queue0 to filesrc1
  </code></pre>
  
  <p>I'm a veteran programmer but a complete newbie to video-stream processing.  I've spent hours going over docs at <a href="http://docs.gstreamer.com/" rel="nofollow">http://docs.gstreamer.com/</a> and searching for examples, but I'm am obviously still not understanding something about how to put together streams.  I did not try to copy the example from the previous question because I don't yet understand it all and I want to start with something basic that I can add to as needed.</p>