simple question about gst api

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

simple question about gst api

박민석

hi.

I have some problem about constructing pipeline.

 

When I run gst-launch, I use it like this,(simple video/audio playback)

 

gst-launch-0.10.exe filesrc location="test.mp4" ! qtdemux name=demux 

  demux.video_00 ! { queue ! omx_mpeg4dec ! ffmpegcolorspace ! directdrawsink }

  demux.audio_00 ! { queue ! faad ! directsoundsink }

 

 

I want to construct upper command with GST API!!

but how??? Below is my test code. but it doesn't work!

I'll appreciate it if you give any comment.

==========================================================================

  bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));

  filesrc = gst_element_factory_make ("filesrc", "myapp_source");
  qtdemux = gst_element_factory_make ("qtdemux", "myapp_demux");

 

  queue_v = gst_element_factory_make ("queue", "myapp_queue_video");
  mp4_dec = gst_element_factory_make ("omx_mpeg4dec", "myapp_dec");
  ccv    = gst_element_factory_make ("ffmpegcolorspace", "myapp_colorspace");
  video_sink= gst_element_factory_make ("directdrawsink", "myapp_directdrawsink");

 

  queue_a = gst_element_factory_make ("queue", "myapp_queue_audio");
  aac_dec = gst_element_factory_make ("faad", "myapp_faad");
  video_sink= gst_element_factory_make ("directsoundsink", "myapp_audiosink"); 
  
  g_object_set (G_OBJECT (filesrc), "location", "iron.mp4", NULL);//filesrc location="test.mp4"
  g_object_set (G_OBJECT (filesrc), "name", "demux", NULL);//qtdemux name=demux, right??

 

  gst_bin_add_many (GST_BIN (bin), filesrc, qtdemux,
                          queue_v, mp4_dec, ccv, video_sink, //video
                          queue_a, aac_dec, audio_sink, //audio
                          NULL);//right??

  gst_element_link(filesrc, qtdemux);


  gst_element_link(qtdemux, queue_v); 

  gst_element_link_many(queue_v, mp4_dec, ccv, video_sink, NULL);//right??
 

  gst_element_link(qtdemux, queue_a); 

  gst_element_link_many(queue_a, aac_dec, audio_sink, NULL);//right??



Min-Seok Park

===============================

Korea Electronics Technology Institute

Multi-Media IP

Tel.031-789-7385

Fax.031-789-7379

=============================== 


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: simple question about gst api

Tim-Philipp Müller-2
On Wed, 2009-10-14 at 18:09 +0900, 박민석 wrote:

> gst-launch-0.10.exe filesrc location="test.mp4" ! qtdemux name=demux  
>
>   demux.video_00 ! { queue ! omx_mpeg4dec ! ffmpegcolorspace !
> directdrawsink }
>
>   demux.audio_00 ! { queue ! faad ! directsoundsink }

The { } are GStreamer 0.8 syntax, you should not use them with GStreamer
0.10. They are not needed any longer.
 
>
> I want to construct upper command with GST API!!
> but how??? Below is my test code. but it doesn't work!
>
> I'll appreciate it if you give any comment.

Please go easy on the ??!?!?!.

The easiest way would be to just use

 pipeline = gst_parse_launch ("filesrc ....", ...);


>   gst_element_link(qtdemux, queue_v);  
>
>   gst_element_link_many(queue_v, mp4_dec, ccv, video_sink,
> NULL);//right??
>  
>
>   gst_element_link(qtdemux, queue_a);  
>
>   gst_element_link_many(queue_a, aac_dec, audio_sink, NULL);//right??

Many of these functions have return values to indicate success or
failure. You should check the return values.

In this case, it is probably the qtdemux -> queues links that fail.
qtdemux has so-called 'dynamic pads' as source pads, which will only be
created once data flow starts. You will have to g_signal_connect() to
the 'pad-added' signal of qtdemux and then link these things in the
callback.

Cheers
 -Tim



------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: simple question about gst api

sledge hammer
In reply to this post by 박민석
You need to connect to the "pad-added" signal of the demuxer(qtdemux). The source pads of qtmux aren't available from the begining. Take a look at this section of the Gstreamer tutorial -->http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/section-dynamic.html


Date: Wed, 14 Oct 2009 18:09:49 +0900
From: [hidden email]
To: [hidden email].
Subject: [gst-devel] simple question about gst api


hi.
I have some problem about constructing pipeline.
 
When I run gst-launch, I use it like this,(simple video/audio playback)
 
gst-launch-0.10.exe filesrc location="test.mp4" ! qtdemux name=demux 
  demux.video_00 ! { queue ! omx_mpeg4dec ! ffmpegcolorspace ! directdrawsink }
  demux.audio_00 ! { queue ! faad ! directsoundsink }
 
 
I want to construct upper command with GST API!!
but how??? Below is my test code. but it doesn't work!
I'll appreciate it if you give any comment.
==========================================================================
  bin = GST_BIN (gst_element_factory_make ("pipeline", NULL));
  filesrc = gst_element_factory_make ("filesrc", "myapp_source");
  qtdemux = gst_element_factory_make ("qtdemux", "myapp_demux");
 
  queue_v = gst_element_factory_make ("queue", "myapp_queue_video");
  mp4_dec = gst_element_factory_make ("omx_mpeg4dec", "myapp_dec");
  ccv    = gst_element_factory_make ("ffmpegcolorspace", "myapp_colorspace");
  video_sink= gst_element_factory_make ("directdrawsink", "myapp_directdrawsink");
 
  queue_a = gst_element_factory_make ("queue", "myapp_queue_audio");
  aac_dec = gst_element_factory_make ("faad", "myapp_faad");
  video_sink= gst_element_factory_make ("directsoundsink", "myapp_audiosink"); 
  
  g_object_set (G_OBJECT (filesrc), "location", "iron.mp4", NULL);//filesrc location="test.mp4"
  g_object_set (G_OBJECT (filesrc), "name", "demux", NULL);//qtdemux name=demux, right??
 
  gst_bin_add_many (GST_BIN (bin), filesrc, qtdemux,
                          queue_v, mp4_dec, ccv, video_sink, //video
                          queue_a, aac_dec, audio_sink, //audio
                          NULL);//right??
  gst_element_link(filesrc, qtdemux);

  gst_element_link(qtdemux, queue_v); 
  gst_element_link_many(queue_v, mp4_dec, ccv, video_sink, NULL);//right??
 
  gst_element_link(qtdemux, queue_a); 
  gst_element_link_many(queue_a, aac_dec, audio_sink, NULL);//right??



Min-Seok Park

===============================

Korea Electronics Technology Institute

Multi-Media IP

Tel.031-789-7385

Fax.031-789-7379

=============================== 


Σύρετε φωτογραφίες στο παράθυρο του Messenger. Δείτε πώς. Κάντε κλικ εδώ!
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel