<h1>gst-launch works fine, but appsrc got Internal data flow 
error.</h1><div><b>Tim-Philipp Müller</b> <a title="gst-launch works fine, but appsrc got Internal data flow error." href="mailto:gstreamer-devel%40lists.freedesktop.org?Subject=Re%3A%20gst-launch%20works%20fine%2C%20but%20appsrc%20got%20Internal%20data%20flow%20error.&In-Reply-To=%3C1351678984.25675.1.camel%40zingle%3E">t.i.m 
at zen.co.uk </a><br><i>Wed Oct 31 03:23:04 PDT 2012</i> 
</div><p>

<hr>
<pre>On Wed, 2012-10-31 at 16:55 +0900, ByoungSoon Lee wrote:

Hi,
 
><i> My first try is this and works fine.
</i>><i>   gst-launch filesrc location=test.avi ! decodebin2 !
</i>><i> ffmpegcolorspace ! autovideosink
</i>><i> 
</i>><i> My second try also works fine, too. 
</i>><i> The video_only.mpeg2 file is a video file without container
</i>><i> information, i.e., only included raw video data.
</i>><i>   gst-launch filesrc location=video_only.mpeg2 ! mpegvideoparse !
</i>><i> ffdec_mpeg2video ! ffmpegcolorspace ! autovideosink
</i>><i> 
</i>><i> I have trouble when I run the code above using appsrc. I got  error
</i>><i> message : "Error Internal data flow error."
</i>><i> Does anybody can give me any suggestions or guide reference?
</i>
Depending on the video sink actually chose, you might also need a
videoscale element between ffmpegcolorspace and autovideosink (for pixel
aspect ration adjustment, if the sink can't scale by itself).

If that's not it, perhaps make a GST_DEBUG log and have a look for where
it posts the error, and look at the lines before that to get an idea
what's going wrong.

 Cheers
  -Tim


</pre><div>Thanks. I tried what you suggested and it works fine.</div><div> </div><div>I apply the same gst-launch pipeline in my i.mx6 (freescale) board, and it also works beautiful</div><div>with a just little difference of the videoscale position.</div>
<div> </div><div>gst-launch-0.10 filesrc location=video_only.mpeg2 ! mpegvideoparse ! ffdec_mpeg2video ! videoscale ! ffmpegcolorspace ! autovideosink</div><div> </div><div>In the appsrc code, I need to change some. </div>
<div>First, remove pad-added signal connect part and second, directly link mpegvideoparse and vpudec.</div><div> </div><div>Now I have working pipeline using appsrc for raw video-only mpeg 2 file.</div><div> </div><div>Thanks</div>
<div>ByoungSoon </div><div> </div><div>Here's the code snippet for the change.</div><div>...<br> app->src = (GstAppSrc*)gst_element_factory_make("appsrc", "mysrc");<br> app->decoder = gst_element_factory_make("mpegvideoparse", "mydecoder");<br>
 app->ffmpeg = gst_element_factory_make("ffdec_mpeg2video", "myffmpeg");<br></div><div> app->videoscale = gst_element_factory_make("videoscale", "myvideoscale");<br> app->convertcolor = gst_element_factory_make("ffmpegcolorspace", "myconvert");<br>
 app->videosink = gst_element_factory_make("autovideosink", "myvsink");</div><div> </div><div> g_assert(app->src);<br> g_assert(app->decoder);<br> g_assert(app->ffmpeg);<br> g_assert(app->convertcolor);<br>
 g_assert(app->videosink);</div><div> </div><div> g_signal_connect(app->src, "need-data", G_CALLBACK(start_feed), app);<br> g_signal_connect(app->src, "enough-data", G_CALLBACK(stop_feed), app);<br>
</div><div> //g_signal_connect(app->decoder, "pad-added",<br> // G_CALLBACK(on_pad_added), app->ffmpeg);</div><div> </div><div> gst_bin_add_many(GST_BIN(app->pipeline), (GstElement*)app->src,<br>  app->decoder, app->ffmpeg, app->videoscale, app->convertcolor, app->videosink, NULL);</div>
<div> </div><div> if(!gst_element_link((GstElement*)app->src, app->decoder)){<br>  g_warning("failed to link src anbd decoder");<br> }</div><div> </div><div> if(!gst_element_link(app->decoder, app->ffmpeg)){<br>
  g_warning("failed to link decoder and ffmpeg");<br> }</div><div>  if(!gst_element_link(app->ffmpeg, app->videoscale)){<br>  g_warning("failed to link ffmpeg and videoscale");<br> }</div><div> if(!gst_element_link(app->videoscale, app->convertcolor)){<br>
  g_warning("failed to link videoscale and convertcolor");<br> }</div><div> if(!gst_element_link(app->convertcolor, app->videosink)){<br>  g_warning("failed to link convertcolor and videosink");<br>
 }<br>...                                                                                                                                       <br></div></p>