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

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

ByoungSoon Lee

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

Tim-Philipp Müller [hidden email]
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");
 }
...                                                                                                                                       


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel