<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 9:02 PM, Mark Scudder <span dir="ltr"><<a href="mailto:mark@markscudder.com" target="_blank">mark@markscudder.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">...<br>
Following the examples on Alex's blog, I open a terminal window, run the set_env.sh script, and issue the following command (based on his example but using a filesink instead of videosink, to save the video):<br>
<br>
~/gst/runtime/bin/gst-launch-1.0 -v -e uvch264src device=/dev/video0 name=src auto-start=true src.vfsrc ! queue ! video/x-raw,format=\(string\)YUY2,width=320,height=240,framerate=10/1 ! xvimagesink sync=false src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! filesink location=/home/mark/test1.mp4<br>

<br>
This works. A small preview window is displayed on the screen, and the h.264 stream is recorded to test1.mp4, though it has to be run through ffmpeg -i test1.mp4 -vocdec copy fixed.mp4 before it's usable in non-GStreamer-based players. (I don't mind that, if there's no way to properly mux it into a compatible mp4 file in the pipeline.)<br>
</blockquote><div><br></div><div>Hi Mark,<br></div><div><br></div><div>You need to add an MP4 muxer if you want an MP4 file. Without the muxer you are just saving the raw h264 stream. The element mp4mux can probably do what you need.<br>
<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
I then open another terminal window, run the set_env.sh script, and change the command to connect to the next camera, and write a different file:<br>
<br>
~/gst/runtime/bin/gst-launch-1.0 -v -e uvch264src device=/dev/video1 name=src auto-start=true src.vfsrc ! queue ! video/x-raw,format=\(string\)YUY2,width=320,height=240,framerate=10/1 ! xvimagesink sync=false src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! filesink location=/home/mark/test2.mp4<br>

<br>
And it doesn't work. GStreamer displays the following in the terminal window:<br>
<br>
...<br>
ERROR: from element /GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: Internal data flow error.<br>
Additional debug info:<br>
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0:<br>
streaming task paused, reason not-negotiated (-4)<br>
EOS on shutdown enabled -- waiting for EOS after Error<br>
Waiting for EOS…<br>
<br>
And does nothing until I Ctrl-C it.<br>
<br>
If the first pipeline is not running, this pipeline runs just fine, but they won't run in parallel. I don't feel that GStreamer is being clear about what/where the problem is, but I understand since it's in development I have to dig and experiment.  I also don't see a reason it wouldn't work, since Linux seems to enumerate the cameras as separate entities, and any binary should be able to run multiple times on the same box if it's opening different devices. I just don't know where to start. Can someone help me get these working in parallel? Like I said, even though c920 support isn't perfect in v4l2src, I was able to record three cameras in parallel.<br>
</blockquote><div><br></div><div>This certainly sounds like a bug or limitation of the uvch264src, though I am not familiar with the internals. I hope somebody more qualified can comment on this.<br><br></div><div> <br></div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Does anyone know if the c920 sends a muxed audio/video stream to the computer, and GStreamer is just demuxing the video off it? In other words, do I always need to explicitly set up audio in my pipeline from the audio device on the camera and then mux it in the pipeline, or is there a way to pull a fully muxed, ready to go mp4 stream off the camera without having GStreamer do the muxing if it's not necessary?<br>
</blockquote><div><br></div><div>You get unmuxed raw audio and raw H264 video from the camera (they are of course muxed on the physical bus ;-)<br></div><div>The audio and video sources appear as two different devices on the computer and you have to mux them yourself in the pipeline. The avimux element has some good examples how you can mux audio and video:<br>
<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-avimux.html">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-avimux.html</a><br>
<br></div><div>Alex<br></div><br></div><br></div></div>