title: Can't save mp4 video after sending eos to pipeline
body: <p>I have tried many different things but I am not able to send and eos message when ctrl+c is pressed and properly stop my pipeline and obtain a video file. Whay am I missing here?</p>
  <pre class="lang-py prettyprint-override"><code>def bus_call(bus, message, loop):
      t = message.type
      if t == Gst.MessageType.EOS:
          logger.info(&quot;End-of-stream\n&quot;)
          loop.quit()
      elif t==Gst.MessageType.WARNING:
          err, debug = message.parse_warning()
          logger.info(&quot;Warning: %s: %s\n&quot; % (err, debug))
      elif t == Gst.MessageType.ERROR:
          err, debug = message.parse_error()
          logger.info(&quot;Error: %s: %s\n&quot; % (err, debug))
          loop.quit()
      return True
  
  # Set up pipeline
  logger.info(&quot;GStreamer initialization&quot;)
  GObject.threads_init()
  Gst.init(None)
  
  logger.info(&quot;Creating Pipeline&quot;)
  pipeline = Gst.Pipeline()
  
  # create and add elements
  ....
  
  loop = GObject.MainLoop()
  bus = pipeline.get_bus()
  bus.add_signal_watch()
  bus.connect(&quot;message&quot;, bus_call, loop)
  
  logger.info(&quot;Starting pipeline&quot;)
  self.gst_pipeline.set_state(Gst.State.PLAYING)
  
  try:
      loop.run()
  except KeyboardInterrupt:
      pipeline.send_event(Gst.Event.new_eos())
  
  pipeline.set_state(Gst.State.NULL)
  
  </code></pre>