That's the best I can determine so far at least by removing it. I'm writing a program using the ruby-gnome2 gstreamer bindings that captures video (v4l) and audio (standard soundcard), displays the video onscreen, loops the audio back out for monitoring, and records to disk using avi/wav. I'll be glad to provide the code, but in consideration of everyone's time I'll provide the gstreamer pipeline I'm first since I'm sure its something simple I'm not doing right.<div>
<br></div><div>My pipeline is separated into several bins and looks like this:</div><div><br></div><div>AudioBin: (source ghost pad to the tee src)</div><div><br></div><div>autoaudiosrc ! audio/x-raw-int ! level ! tee name=audiotee</div>
<div>audiotee ! autoaudiosink</div><div><br></div><div>VideoBin: (source ghost pad to the tee src)</div><div><br></div><div>v4l2src ! video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)30000/1001, width=(int)720, height=(int)480 ! videorate ! tee name=videotee</div>
<div>videotee ! xvimagesink<br clear="all"><br></div><div>RecorderBin: (audio and video sink pads linked to the audio queue and video queue respectively)</div><div><br></div><div>queue name=audioqueue ! avimux name=mux</div>
<div>queue name=videoqueue ! jpegenc ! mux ! filesink</div><div><br></div><div>AudioBin ! VideoBin ! RecorderBin</div><div><br></div><div>The (horrible mess) of code that does all this is as follows:</div><div><br></div><div>
<div> @pipeline = Gst::Pipeline.new</div><div> </div><div> @audiobin = Gst::Bin.new()</div><div> @<a href="http://audiobin.name">audiobin.name</a> = "AudioBin"</div><div> </div><div> @autoaudiosrc = Gst::ElementFactory.make("autoaudiosrc")</div>
<div> @audiocaps = Gst::ElementFactory.make("capsfilter")</div><div> @audiocaps.caps = Gst::Caps.parse("audio/x-raw-int")</div><div> @level = Gst::ElementFactory.make("level")</div><div>
@level.peak_ttl = 0</div><div> @level.peak_falloff = 20</div><div> @audiotee = Gst::ElementFactory.make("tee")</div><div> @audiosink = Gst::ElementFactory.make("autoaudiosink")</div><div> @audiobin.add(@autoaudiosrc)</div>
<div> @audiobin.add(@audiocaps)</div><div> @audiobin.add(@level)</div><div> @audiobin.add(@audiotee)</div><div> @audiobin.add(@audiosink)</div><div><br></div><div> @autoaudiosrc >> @audiocaps >> @audiotee </div>
<div> @audiotee >> @level >> @audiosink</div><div><br></div><div> @audiotee_src_pad = @audiotee.get_request_pad("src%d")</div><div> @audiobin_ghost_pad = Gst::GhostPad.new('src', @audiotee_src_pad)</div>
<div> @audiobin.add_pad(@audiobin_ghost_pad)</div><div><br></div><div> @videobin = Gst::Bin.new()</div><div> @<a href="http://videobin.name">videobin.name</a> = "VideoBin"</div><div><br></div><div> @v4l2src = Gst::ElementFactory.make("v4l2src")</div>
<div> @videocaps = Gst::ElementFactory.make("capsfilter")</div><div> @videocaps.caps = Gst::Caps.parse("video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)30000/1001, width=(int)720, height=(int)480")</div>
<div> @videorate = Gst::ElementFactory.make("videorate")</div><div> @videotee = Gst::ElementFactory.make("tee")</div><div> @videosink = Gst::ElementFactory.make("xvimagesink")</div><div>
@videosink.set_xwindow_id(@video.window.xid)</div><div> </div><div> @videobin.add(@v4l2src)</div><div> @videobin.add(@videocaps)</div><div> @videobin.add(@videorate)</div><div> @videobin.add(@videotee)</div>
<div> @videobin.add(@videosink)</div><div><br></div><div> @v4l2src >> @videocaps >> @videorate >> @videotee</div><div> @videotee >> @videosink</div><div><br></div><div> @videotee_src_pad = @videotee.get_request_pad("src%d")</div>
<div> @videobin_ghost_pad = Gst::GhostPad.new('src',@videotee_src_pad)</div><div> @videobin.add_pad(@videobin_ghost_pad)</div><div> </div><div> @recorderbin = Gst::Bin.new()</div><div> @<a href="http://recorderbin.name">recorderbin.name</a> = "RecorderBin"</div>
<div><br></div><div> @audioqueue = Gst::ElementFactory.make("queue")</div><div> @videoqueue = Gst::ElementFactory.make("queue")</div><div> @jpegenc = Gst::ElementFactory.make("jpegenc")</div>
<div> @avimux = Gst::ElementFactory.make("avimux")</div><div> @filesink = Gst::ElementFactory.make("filesink")</div><div> @filesink.stop</div><div> @filesink.location = "test.avi"</div>
<div><br></div><div> @recorderbin.add(@audioqueue)</div><div> @recorderbin.add(@videoqueue)</div><div> @recorderbin.add(@jpegenc)</div><div> @recorderbin.add(@avimux)</div><div> @recorderbin.add(@filesink)</div>
<div> </div><div> @audioqueue >> @avimux</div><div> @videoqueue >> @jpegenc >> @avimux</div><div> @avimux >> @filesink</div><div> </div><div> @audioqueue_audio_sink_pad = @audioqueue.get_static_pad("sink")</div>
<div> @recorderbin_audio_ghost_pad = Gst::GhostPad.new('audio', @audioqueue_audio_sink_pad)</div><div> @recorderbin.add_pad(@recorderbin_audio_ghost_pad)</div><div><br></div><div> @videoqueue_video_sink_pad = @videoqueue.get_static_pad("sink")</div>
<div> @recorderbin_video_ghost_pad = Gst::GhostPad.new('video', @videoqueue_video_sink_pad)</div><div> @recorderbin.add_pad(@recorderbin_video_ghost_pad)</div><div> </div><div> # add objects to the main pipeline</div>
<div> @pipeline.add(@audiobin)</div><div> @pipeline.add(@videobin)</div><div><br></div><div> @pipeline.add(@recorderbin)</div><div> </div><div> @audiobin >> @recorderbin</div><div> @videobin >> @recorderbin</div>
</div><div><br></div><div>Thanks for any help you can provide,</div><div> <br>Matt<br>
</div>