Hello,
Following is code which plays mp3 using playbin /* set up */ play = gst_element_factory_make ("playbin2", "play"); g_object_set (G_OBJECT (play), "uri", "file:///home/basavaraj/Music/JabSeTereNaina.mp3", NULL); bus = gst_pipeline_get_bus (GST_PIPELINE (play)); // gst_bus_add_watch (bus, my_bus_callback, loop); gst_object_unref (bus); gst_element_set_state (play, GST_STATE_PLAYING); Following is code which does not play mp3. Please help me what all plugins we need to connect and how to find their capabilities /* Create gstreamer elements */ GstElement* pipeline = gst_pipeline_new ("audio-player"); GstElement* source = gst_element_factory_make ("filesrc", "file-source"); GstElement* demuxer = gst_element_factory_make ("mpegdemux2", "mpeg-demuxer"); GstElement* decoder = gst_element_factory_make ("flump3dec", "fluendo-decoder"); // GstElement* decoder = gst_element_factory_make("decodebin", "decoderbin"); GstElement* conv = gst_element_factory_make ("audioconvert", "converter"); GstElement* sink = gst_element_factory_make ("autoaudiosink", "audio-output"); if (!pipeline || !source || !demuxer || !decoder || !conv || !sink) { g_printerr ("One element could not be created. Exiting.\n"); return -1; } /* Set up the pipeline */ /* we set the input filename to the source element */ // g_object_set (G_OBJECT (source), "uri", "file:///home/basavaraj/Music/Jab.mp3", NULL); g_object_set (G_OBJECT (source), "location", "/home/basavaraj/Music/Jab.mp3", NULL); /* we add a message handler */ GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); gst_bus_add_watch (bus, bus_call, loop); gst_object_unref (bus); /* we add all elements into the pipeline */ /* file-source | mp3-demuxer | mp3-decoder | converter | alsa-output */ gst_bin_add_many (GST_BIN (pipeline), source, demuxer, decoder, conv, sink, NULL); /* we link the elements together */ /* file-source -> mp3-demuxer ~> mp3-decoder -> converter -> alsa-output */ gst_element_link (source, demuxer); g_signal_connect (demuxer, "pad-added", G_CALLBACK (on_pad_added), decoder); /* Set the pipeline to "playing" state*/ g_print ("Now playing: %s\n", argv[1]); gst_element_set_state (pipeline, GST_STATE_PLAYING); Thanks in advance, Basavaraj
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
It would be easier if you show your on_pad_added function, and if you tell exactly what error messages do you get when you run your application.
To investigate the capabilities of a element you can use gst-inspect. On a terminal you can type for example: gst-inspect flump3dec it will give an complete specification of the flump3dec element. best regards, Katcipis On Thu, Nov 19, 2009 at 6:40 AM, basavaraj P <[hidden email]> wrote: Hello, -- "Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..." ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by basavaraj P
Hi, May I know some more difference
b/w pause and running state, other then mentioned in GStreamer Application
Development Manual (0.10.23.1). Shiv The information contained in this e-mail message and in any attachments/annexure/appendices is confidential to the recipient and may contain privileged information. If you are not the intended recipient, please notify the sender and delete the message along with any attachments/annexure/appendices. You should not disclose, copy or otherwise use the information contained in the message or any annexure. Any views expressed in this e-mail are those of the individual sender except where the sender specifically states them to be the views of Toshiba Embedded Software India Pvt. Ltd. (TESI),Bangalore. Although this transmission and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by Toshiba Embedded Software India Pvt. Ltd, for any loss or damage arising in any way from its use. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Tiago Katcipis
Hi,
Am Donnerstag, den 19.11.2009, 07:41 -0200 schrieb Tiago Katcipis: > It would be easier if you show your on_pad_added function, and if you > tell exactly what error messages do you get when you run your > application. > > To investigate the capabilities of a element you can use gst-inspect. > > On a terminal you can type for example: > gst-inspect flump3dec > > it will give an complete specification of the flump3dec element. > > best regards, > Katcipis > > On Thu, Nov 19, 2009 at 6:40 AM, basavaraj P <[hidden email]> > wrote: > Hello, > > Following is code which plays mp3 using playbin > > /* set up */ > play = gst_element_factory_make ("playbin2", "play"); > g_object_set (G_OBJECT (play), "uri", > "file:///home/basavaraj/Music/JabSeTereNaina.mp3", NULL); > > bus = gst_pipeline_get_bus (GST_PIPELINE (play)); > // gst_bus_add_watch (bus, my_bus_callback, loop); > gst_object_unref (bus); > > gst_element_set_state (play, GST_STATE_PLAYING); > > > Following is code which does not play mp3. Please help me what > all plugins we need to connect and > how to find their capabilities > > /* Create gstreamer elements */ > GstElement* pipeline = gst_pipeline_new ("audio-player"); > GstElement* source = gst_element_factory_make ("filesrc", > "file-source"); > GstElement* demuxer = gst_element_factory_make > ("mpegdemux2", "mpeg-demuxer"); > GstElement* decoder = gst_element_factory_make > ("flump3dec", "fluendo-decoder"); > // GstElement* decoder = > gst_element_factory_make("decodebin", "decoderbin"); > GstElement* conv = gst_element_factory_make > ("audioconvert", "converter"); > GstElement* sink = gst_element_factory_make > ("autoaudiosink", "audio-output"); > > if (!pipeline || !source || !demuxer || !decoder || !conv > || !sink) { > g_printerr ("One element could not be created. > Exiting.\n"); > return -1; > } > > /* Set up the pipeline */ > > /* we set the input filename to the source element */ > // g_object_set (G_OBJECT (source), "uri", > "file:///home/basavaraj/Music/Jab.mp3", NULL); > g_object_set (G_OBJECT (source), "location", > "/home/basavaraj/Music/Jab.mp3", NULL); > > /* we add a message handler */ > GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE > (pipeline)); > gst_bus_add_watch (bus, bus_call, loop); > gst_object_unref (bus); > > /* we add all elements into the pipeline */ > /* file-source | mp3-demuxer | mp3-decoder | converter | > alsa-output */ > gst_bin_add_many (GST_BIN (pipeline), > source, demuxer, decoder, conv, sink, > NULL); > > /* we link the elements together */ > /* file-source -> mp3-demuxer ~> mp3-decoder -> converter -> > alsa-output */ > gst_element_link (source, demuxer); > g_signal_connect (demuxer, "pad-added", G_CALLBACK > (on_pad_added), decoder); > > /* Set the pipeline to "playing" state*/ > g_print ("Now playing: %s\n", argv[1]); > gst_element_set_state (pipeline, GST_STATE_PLAYING); > > > Thanks in advance, > Basavaraj Try this pipeline to play mp3s. Because it's audio-only (beside mp3-tags) you don't need a demuxer. gst-launch-0.10 -v filesrc location=song.mp3 ! mp3parse ! flump3dec ! audioconvert ! audioresample ! autoaudiosink hth, lukas ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Case 1:
The below pipeline should play any mp3 file. gst-launch -v filesrc location=song.mp3 ! mad ! audioconvert ! audioresample ! autoaudiosink Case 2: And optionally if the file has id3 tags then use gst-launch -v filesrc location=song.mp3 ! id3demux ! mad ! audioconvert ! audioresample ! autoaudiosink You need to additional install mad(mp3 decoder). Only in case 2 you need to have the callback for "pad-added" signal. Check out the helloworld example and similar from manual. On Thu, Nov 19, 2009 at 4:14 PM, Lukas Ruetz <[hidden email]> wrote: Hi, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Tiago Katcipis
Hello Katcipis, Following is the on_pad_added function. static void on_pad_added (GstElement *element, GstPad *pad, gpointer data) { GstPad *sinkpad; GstElement *decoder = (GstElement *) data; /* We can now link this pad with the mp3-decoder sink pad */ g_print ("Dynamic pad created, linking demuxer/decoder\n"); sinkpad = gst_element_get_static_pad (decoder, "sink"); gst_pad_link (pad, sinkpad); gst_object_unref (sinkpad); } Thanks, Basavaraj On Thu, Nov 19, 2009 at 3:11 PM, Tiago Katcipis <[hidden email]> wrote: It would be easier if you show your on_pad_added function, and if you tell exactly what error messages do you get when you run your application. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Lukas Ruetz
Hello Lucas, I get following error, if I try gst-launch-0.10 -v filesrc location=song.mp3 ! mp3parse ! flump3dec ! audioconvert ! audioresample ! autoaudiosink Error WARNING: erroneous pipeline: no element "mp3parse" Thanks, Basavaraj On Thu, Nov 19, 2009 at 4:14 PM, Lukas Ruetz <[hidden email]> wrote: Hi, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Jyoti-2
Hello Jyoti, I get following error gst-launch -v filesrc location=Jab.mp3 ! id3demux ! flump3dec ! audioconvert ! audioresample ! autoaudiosink Setting pipeline to PAUSED ... Pipeline is PREROLLING ... ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data flow error. Additional debug info: gstbasesrc.c(2378): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0: streaming task paused, reason not-linked (-1) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... /GstPipeline:pipeline0/GstID3Demux:id3demux0.GstPad:src: caps = NULL Freeing pipeline ... Thanks, Basavaraj
On Thu, Nov 19, 2009 at 4:36 PM, Jyoti <[hidden email]> wrote: Case 1: ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by basavaraj P
Hi,
Am Donnerstag, den 19.11.2009, 19:14 +0530 schrieb basavaraj P: > > Hello Lucas, > > I get following error, if I try > > gst-launch-0.10 -v filesrc location=song.mp3 ! mp3parse ! flump3dec ! > audioconvert ! audioresample ! autoaudiosink > > Error > WARNING: erroneous pipeline: no element "mp3parse" > > Thanks, > Basavaraj (please don't top-post.) If mp3parse is not found, you don't have gst-plugins-ugly installed. Use the plugin-listing: http://gstreamer.freedesktop.org/documentation/plugins.html lukas ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by basavaraj P
Basavaraj,
seeing your on_pad_added function it sens that you never connect the decoder on the convert, and never connect the convert on the sink. The following is missing after you connect the signal: /* we link the elements together */ /* file-source -> mp3-demuxer ~> mp3-decoder -> converter -> alsa-output */ gst_element_link (source, demuxer); g_signal_connect (demuxer, "pad-added", G_CALLBACK (on_pad_added), decoder); gst_element_link (decoder, conv); gst_element_link (conv, sink); hope this helps you best regards, Katcipis On Thu, Nov 19, 2009 at 11:40 AM, basavaraj P <[hidden email]> wrote:
-- "Se você se perder na selva africana, não precisa se desesperar. Basta sentar em uma pedra e começar a instalar GNU/Linux em seu laptop. Em menos de 5 minutos aparecerá alguém pra discordar de sua escolha de distribuição, do particionamento, do gerenciador de janelas, do ambiente de desktop, do editor de textos..." ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Lukas Ruetz
On Thu, Nov 19, 2009 at 7:30 PM, Lukas Ruetz <[hidden email]> wrote: Hi, Thanks you Lukas, Problem actually solved as we don;t need demuxer. I was unnecessary using demuxer. Thanks, Basavaraj ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
In reply to this post by Tiago Katcipis
Hello Katcipis,
Thanks for this. It worked for me. Thanks, Basavaraj On Thu, Nov 19, 2009 at 7:30 PM, Tiago Katcipis <[hidden email]> wrote: Basavaraj, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |