gst-launch works fine, but appsrc got Internal data flow error.

ByoungSoon Lee l22bss at gmail.com
Wed Oct 31 23:02:28 PDT 2012


gst-launch works fine, but appsrc got Internal data flow error.
*Tim-Philipp Müller* t.i.m at zen.co.uk
<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>
*Wed Oct 31 03:23:04 PDT 2012*

------------------------------

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

Hi,

>* My first try is this and works fine.*>*   gst-launch filesrc location=test.avi ! decodebin2 !*>* ffmpegcolorspace ! autovideosink*>* *>* My second try also works fine, too. *>* The video_only.mpeg2 file is a video file without container*>* information, i.e., only included raw video data.*>*   gst-launch filesrc location=video_only.mpeg2 ! mpegvideoparse !*>* ffdec_mpeg2video ! ffmpegcolorspace ! autovideosink*>* *>* I have trouble when I run the code above using appsrc. I got  error*>* message : "Error Internal data flow error."*>* Does anybody can give me any suggestions or guide reference?*
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



Thanks. I tried what you suggested and it works fine.

I apply the same gst-launch pipeline in my i.mx6 (freescale) board, and it
also works beautiful
with a just little difference of the videoscale position.

gst-launch-0.10 filesrc location=video_only.mpeg2 ! mpegvideoparse
! ffdec_mpeg2video ! videoscale ! ffmpegcolorspace ! autovideosink

In the appsrc code, I need to change some.
First, remove pad-added signal connect part and second, directly link
mpegvideoparse and vpudec.

Now I have working pipeline using appsrc for raw video-only mpeg 2 file.

Thanks
ByoungSoon

Here's the code snippet for the change.
...
 app->src = (GstAppSrc*)gst_element_factory_make("appsrc", "mysrc");
 app->decoder = gst_element_factory_make("mpegvideoparse", "mydecoder");
 app->ffmpeg = gst_element_factory_make("ffdec_mpeg2video", "myffmpeg");
 app->videoscale = gst_element_factory_make("videoscale", "myvideoscale");
 app->convertcolor = gst_element_factory_make("ffmpegcolorspace",
"myconvert");
 app->videosink = gst_element_factory_make("autovideosink", "myvsink");

 g_assert(app->src);
 g_assert(app->decoder);
 g_assert(app->ffmpeg);
 g_assert(app->convertcolor);
 g_assert(app->videosink);

 g_signal_connect(app->src, "need-data", G_CALLBACK(start_feed), app);
 g_signal_connect(app->src, "enough-data", G_CALLBACK(stop_feed), app);
 //g_signal_connect(app->decoder, "pad-added",
 // G_CALLBACK(on_pad_added), app->ffmpeg);

 gst_bin_add_many(GST_BIN(app->pipeline), (GstElement*)app->src,
  app->decoder, app->ffmpeg, app->videoscale, app->convertcolor,
app->videosink, NULL);

 if(!gst_element_link((GstElement*)app->src, app->decoder)){
  g_warning("failed to link src anbd decoder");
 }

 if(!gst_element_link(app->decoder, app->ffmpeg)){
  g_warning("failed to link decoder and ffmpeg");
 }
  if(!gst_element_link(app->ffmpeg, app->videoscale)){
  g_warning("failed to link ffmpeg and videoscale");
 }
 if(!gst_element_link(app->videoscale, app->convertcolor)){
  g_warning("failed to link videoscale and convertcolor");
 }
 if(!gst_element_link(app->convertcolor, app->videosink)){
  g_warning("failed to link convertcolor and videosink");
 }
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121101/37f739e5/attachment-0001.html>


More information about the gstreamer-devel mailing list