[gst-devel] See and record a webcam stream

carloscastro7 at gmail.com carloscastro7 at gmail.com
Thu Jan 7 20:36:17 CET 2010


With a little bit of work I managed to get it to work...

Carlos Castro

Em 6 de Jan de 2010 15:21, Carlos Castro <carloscastro7 at gmail.com> escreveu:
> Hi everyone,



> I'm trying to build a simple GTK app using GST as a backend to see and

> record a webcam stream.



> I can do both but separately... My problem is doing both at the same time.

> What I'm trying to accomplish is this:



> gst-launch-0.10 v4l2src \

> ! videorate \

> ! video/x-raw-yuv,framerate=25/2 \

> ! ffmpegcolorspace \

> ! tee name=t1 \

> ! queue \

> ! xvimagesink sync=false t1. \

> ! queue \

> ! theoraenc quality=16 \

> ! oggmux name=mux osssrc \

> ! audio/x-raw-int,rate=22050,channels=1 \

> ! queue \

> ! audioconvert \

> ! vorbisenc quality=0.2 \

> ! mux. mux. \

> ! queue \

> ! filesink location=test.ogg



> My code is this:



> ...

> m_pipeline = gst_pipeline_new ("pipeline");

> m_bin = gst_bin_new ("bin");

> m_source = gst_element_factory_make ("v4l2src", "video_src");

> m_videorate = gst_element_factory_make ("videorate", "videorate");

> m_framerate = gst_element_factory_make

> ("video/x-raw-yuv,framerate=25/2", "framerate");

> m_colorspace = gst_element_factory_make  
> ("ffmpegcolorspace", "colorspace");

> m_tee = gst_element_factory_make ("tee name=t1", "t1");

> m_queue = gst_element_factory_make ("queue", "queue");

> m_imagesink = gst_element_factory_make ("xvimagesink sync=false t1.",

> "imagesink");

> m_queue2 = gst_element_factory_make ("queue", "queue2");

> m_videoenc = gst_element_factory_make ("theoraenc  
> quality=16", "video_enc");

> m_mux = gst_element_factory_make ("oggmux name=mux osssrc", "mux");

> m_audio = gst_element_factory_make

> ("audio/x-raw-int,rate=22050,channels=1", "audio");

> m_queue3 = gst_element_factory_make ("queue", "queue3");

> m_audiocon = gst_element_factory_make ("audioconvert", "audio_con");

> m_audioenc = gst_element_factory_make ("vorbisenc  
> quality=0.2", "audio_enc");

> m_mux2 = gst_element_factory_make ("mux. mux.", "mux2");

> m_queue4 = gst_element_factory_make ("queue", "queue4");

> m_file = gst_element_factory_make ("filesink  
> location=test.ogg", "filesink");



> gst_bin_add_many (GST_BIN (m_bin), m_source, m_videorate, m_framerate,

> m_colorspace, m_tee, m_queue, m_imagesink, m_queue2, m_videoenc,

> m_mux, m_audio, m_queue3, m_audiocon, m_audioenc, m_mux2, m_queue4,

> m_file , NULL);

> gst_bin_add (GST_BIN (m_pipeline), m_bin);

> gst_element_link_many (m_source, m_videorate, m_framerate,

> m_colorspace, m_tee, m_queue,

> m_imagesink, m_queue2, m_videoenc, m_mux, m_audio, m_queue3,

> m_audiocon, m_audioenc, m_mux2, m_queue4, m_file , NULL);



> if (GST_IS_X_OVERLAY (m_imagesink))

> gst_x_overlay_set_xwindow_id (GST_X_OVERLAY (m_imagesink),

> GPOINTER_TO_INT (window));



> gst_element_set_state (m_pipeline, GST_STATE_PLAYING);

> ...



> Can anyone help me on what I'm doing wrong?





> Thanks,

> Carlos Castro



> --

> Cumprimentos,

> Carlos Castro

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100107/dd55b2e6/attachment.htm>


More information about the gstreamer-devel mailing list