I&#39;m trying to use gstreamer to mux data from a hardware MPEG4-ES encoder into an MOV file. My code is based off the hello world program. The code is listed below. When I run this code I get the following error message:<br>
<br>Now playing: 2010_12_17_Good.m4v<br>Running...<br>Error: Could not multiplex stream.<br>Returned, stopping playback<br>Deleting pipeline<br><br>Is there a way to do this?<br><br><br>int<br>main (int   argc,<br>      char *argv[])<br>
{<br>  GMainLoop *loop;<br><br>  GstElement *pipeline, *source, *parse, *muxer, *sink;<br>  GstBus *bus;<br><br>  /* Initialisation */<br>  gst_init (&amp;argc, &amp;argv);<br><br>  loop = g_main_loop_new (NULL, FALSE);<br>
<br><br>  /* Check input arguments */<br>  if (argc != 3) {<br>    g_printerr (&quot;Usage: %s &lt;input mpeg4-es&gt; &lt;output avi&gt;\n&quot;, argv[0]);<br>    return -1;<br>  }<br><br><br>  /* Create gstreamer elements */<br>
  pipeline = gst_pipeline_new (&quot;audio-player&quot;);<br>  source   = gst_element_factory_make (&quot;filesrc&quot;,       &quot;file-source&quot;);<br>  parse    = gst_element_factory_make (&quot;mpeg4videoparse&quot;,      &quot;mpeg4-parse&quot;);<br>
  muxer    = gst_element_factory_make (&quot;qtmux&quot;,      &quot;qt-muxer&quot;);<br>  //decoder  = gst_element_factory_make (&quot;vorbisdec&quot;,     &quot;vorbis-decoder&quot;);<br>  //conv     = gst_element_factory_make (&quot;audioconvert&quot;,  &quot;converter&quot;);<br>
  sink     = gst_element_factory_make (&quot;filesink&quot;, &quot;file-output&quot;);<br><br>  if (!pipeline || !source || !parse || !muxer || !sink) {<br>    g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
    return -1;<br>  }<br><br>  /* Set up the pipeline */<br><br>  /* we set the input filename to the source element */<br>  g_object_set (G_OBJECT (source), &quot;location&quot;, argv[1], NULL);<br>  g_object_set (G_OBJECT (sink), &quot;location&quot;, argv[2], NULL);<br>
<br>  /* we add a message handler */<br>  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>  gst_bus_add_watch (bus, bus_call, loop);<br>  gst_object_unref (bus);<br><br>  /* we add all elements into the pipeline */<br>
  /* file-source | ogg-demuxer | vorbis-decoder | converter | alsa-output */<br>  gst_bin_add_many (GST_BIN (pipeline),<br>                    source, parse, muxer, sink, NULL);<br><br>  /* we link the elements together */<br>
  /* file-source -&gt; ogg-demuxer ~&gt; vorbis-decoder -&gt; converter -&gt; alsa-output */<br>  gst_element_link (source, parse);<br>  gst_element_link (parse, muxer);<br>  gst_element_link (muxer, sink);<br>  //g_signal_connect (muxer, &quot;pad-added&quot;, G_CALLBACK (on_pad_added), decoder);<br>
<br>  /* note that the demuxer will be linked to the decoder dynamically.<br>     The reason is that Ogg may contain various streams (for example<br>     audio and video). The source pad(s) will be created at run time,<br>
     by the demuxer when it detects the amount and nature of streams.<br>     Therefore we connect a callback function which will be executed<br>     when the &quot;pad-added&quot; is emitted.*/<br><br><br>  /* Set the pipeline to &quot;playing&quot; state*/<br>
  g_print (&quot;Now playing: %s\n&quot;, argv[1]);<br>  gst_element_set_state (pipeline, GST_STATE_PLAYING);<br><br><br>  /* Iterate */<br>  g_print (&quot;Running...\n&quot;);<br>  g_main_loop_run (loop);<br><br><br>  /* Out of the main loop, clean up nicely */<br>
  g_print (&quot;Returned, stopping playback\n&quot;);<br>  gst_element_set_state (pipeline, GST_STATE_NULL);<br><br>  g_print (&quot;Deleting pipeline\n&quot;);<br>  gst_object_unref (GST_OBJECT (pipeline));<br><br>  return 0;<br>
}<br><br clear="all"><br>-- <br>Nicholas Butts<br>SENIOR FIRMWARE ENGINEER<br><br>Appareo Systems, LLC<br>1810 NDSU Research Circle N<br>Fargo, ND 58102<br><br>P: (701) 356-2200<br>F: (701) 356-3157<br><br><a href="http://www.appareo.com">http://www.appareo.com</a><br>
<br><a href="mailto:nbutts@appareo.com">nbutts@appareo.com</a><br><br><br><br>NOTICE: This message {including attachments} is covered by the Electronic Communication Privacy Act, 18 U.S.C. sections 2510-2521, is CONFIDENTIAL and may also be protected by ATTORNEY-CLIENT OR OTHER PRIVILEGE. If you believe that it has been sent to you in error, do not read it. If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited. Please reply to the sender that you have received the message in error and then delete it.<br>