Multiple c920s on GStreamer 1.2.3

Alexandru Csete oz9aec at gmail.com
Thu Feb 27 13:15:11 PST 2014


On Thu, Feb 27, 2014 at 9:02 PM, Mark Scudder <mark at markscudder.com> wrote:

> ...
> 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):
>
> ~/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
>
> 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.)
>

Hi Mark,

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.



> 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:
>
> ~/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
>
> And it doesn't work. GStreamer displays the following in the terminal
> window:
>
> ...
> ERROR: from element
> /GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: Internal data
> flow error.
> Additional debug info:
> gstbasesrc.c(2865): gst_base_src_loop ():
> /GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0:
> streaming task paused, reason not-negotiated (-4)
> EOS on shutdown enabled -- waiting for EOS after Error
> Waiting for EOS...
>
> And does nothing until I Ctrl-C it.
>
> 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.
>

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.



>
> 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?
>

You get unmuxed raw audio and raw H264 video from the camera (they are of
course muxed on the physical bus ;-)
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:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-avimux.html

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140227/e21c3d8f/attachment.html>


More information about the gstreamer-devel mailing list