can't stream webcam logitech c310

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

can't stream webcam logitech c310

henryco
hello,

after several attempts i can't figure out why the following pipeline doesnt work

gst-launch-1.0 -v v4l2src device=/dev/video0  ! video/x-raw, width=960, height=720, framerate=30 ! x264enc ! rtph264pay ! udpsink host=192.168.1.10 port=5001

and results in the following error

WARNING: erroneous pipeline: could not link v4l2src0 to x264enc0

some help will be much appreciated, thanks in advance

fred
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
i can add that i'm using a logitech C310 webcam :

 v4l2-ctl --all
Driver Info (not using libv4l2):
        Driver name   : uvcvideo
        Card type     : UVC Camera (046d:0825)
        Bus info      : usb-3f980000.usb-1.4
        Driver version: 4.4.34
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height  : 1280/720
        Pixel Format  : 'MJPG'
        Field         : None
        Bytes per Line: 0
        Size Image    : 816000
        Colorspace    : SRGB
        Flags         :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 1280, Height 720
        Default     : Left 0, Top 0, Width 1280, Height 720
        Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

Arjen Veenhuizen
It looks like your webcam only outputs MJPG (which makes sense). Therefor, you have to first decode the stream before you can encode it into h264.

Something along the lines of:
gst-launch-1.0 -v v4l2src device=/dev/video0  ! image/jpeg, width=1280, height=720, framerate=(fraction)30/1 ! jpegdec ! videoconvert ! queue ! x264enc ! queue ! rtph264pay ! udpsink host=192.168.1.10 port=5001
should get things going.
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
thank you, this works but jpegdec takes 98% CPU of my raspberry Pi, that's why i want either

1) to send the MJPG format as it is, which indeed works with the following pipelines:

pi side
gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720,framerate=30/1 !
udpsink host=192.168.1.10 port=5001
PC receiver side
gst-launch-1.0 -v udpsrc port=5001 ! jpegparse ! jpegdec ! autovideosink sync=false

or

2) take the raw video format from the webcam with the pipeline of my first post ... but is there any way to force the webcam to output the video raw format ?

i could be satisfied with 1) (gives no more than 6 Mb/s in MJPG), but i would like to serve this within a gst-rtsp server but the following fails :

./test-launch "( v4l2src device=/dev/video0 ! image/jpeg,width=1280,height=720,framerate=30/1 ! jpegparse ! videorate ! rtpjpegpay name=pay0 pt=96 )"
stream ready at rtsp://127.0.0.1:8554/test
Segmentation fault

and i have no idea why !


Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
Does'nt this mean that both raw and MJPG format are available from the cam ?

v4l2-ctl --list-formats
ioctl: VIDIOC_ENUM_FMT
        Index       : 0
        Type        : Video Capture
        Pixel Format: 'YUYV'
        Name        : YUYV 4:2:2

        Index       : 1
        Type        : Video Capture
        Pixel Format: 'MJPG' (compressed)
        Name        : Motion-JPEG
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

Arjen Veenhuizen
This post was updated on .
That would indeed imply that the webcam can deliver raw video as well.
Perhaps the following pipeline works?
gst-launch-1.0 -v v4l2src device=/dev/video0  ! capsfilter caps="video./x-raw,format=YUY2,width=1280,height=720,framerate=(fraction)30/1" ! videoconvert ! queue ! x264enc ! queue ! rtph264pay ! udpsink host=192.168.1.10 port=5001
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco

Yes! thank you

Without success i had tried the v4l2src supported formats UYVY and YVYU , because both seemed closer to
YUYV given by v4l2-ctl --list-formats-ext for my cam...)

I don't know how you expected YUY2 to work better... but your format=YUY2 did allow the pipeline to execute and i was also able to stream this over rtsp (the video received is all right) with this pipeline from my Pi

 gst-launch-1.0 -v v4l2src device=/dev/video0 ! "video/x-raw, format=YUY2, width=960,
height=720, framerate=(fraction)10/1" ! videoconvert ! queue ! omxh264enc ! queue
! rtph264pay name=pay0 pt=96 config-interval=2 ! udpsink host=192.168.1.10 port=5001

(longer pipeline receiver side including caps=...)

So in principle the same should also work within a gst-rtsp command :

./test-launch "( v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, width=960,
height=720, framerate=(fraction)10/1 ! videoconvert ! queue ! omxh264enc ! queue !
rtph264pay name=pay0 pt=96 config-interval=2 )"

But i'm not able to receive this on zoneminder (yet i'm sure i have zoneminder configured all right for ffmpeg other rtsp because i can successfully stream to it with the exact same test-launch command except modified for the pi camera instead of webcam) ...
zoneminder says it can't open the source (says operation in progress) ...

are there known problems related to gst-rtsp that could explain this ?

regards,
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

Arjen Veenhuizen
I found the mapping between YUY2 and YUYV here: http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet
YUY2 is the standard YUYV 4:2:2 pixel format and corresponds to the YUYV format on the Logitech QuickCam Pro 9000. For the other formats supported by the Logitech cameras see Pixel formats.
W.r.t. gst-rtsp-server, can't help you there. Never used it. Sorry.
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

Mandar Joshi
In reply to this post by henryco
>
> are there known problems related to gst-rtsp that could explain this ?
>
Also changed the port with

#define DEFAULT_RTSP_PORT "8556" in test-launch.c
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

Mandar Joshi
In reply to this post by henryco
>
> are there known problems related to gst-rtsp that could explain this ?
>

henryco,
Gmail is classifying all your messages as spam. That's why I didn't
get any of your posts. I haven't had a chance to go through your
entire thread yet.

Anyway, I just wanted to quickly add that I've used Logitech C310 with
Raspberry Pi 2 with omxh264enc and gst-rtsp-server.

I just tested the following pipeline and it works well.
Note: I've modified the test-launch example to bind to eth0
(192.168.1.202) using gst_rtsp_media_factory_set_launch (factory,
argv[1]);

GST_DEBUG=3 ./test-launch "( v4l2src device=/dev/video0 !
video/x-raw,width=960,height=720,format=I420,framerate=30/1 !
omxh264enc ! video/x-h264,profile=high ! rtph264pay name=pay0 pt=96
config-interval=1 )" 192.168.1.202

GST_DEBUG=3 gst-launch-1.0 rtspsrc
location=rtsp://192.168.1.202:8556/test ! rtph264depay ! avdec_h264 !
xvimagesink sync=false

Regards
Mandar Joshi
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
hello,

Thank you for your pipelines. i have just tested them but it fails on my pi (with my pi IP adress) : message "connection refused". I had noticed something new in the latest version of raspbian : ssh is no more activated by default e.g the desktop (through hdmi) is becoming the default usage (may be because of the more powerfull raspberry 3). So i'm wondering if they did not adde also other protections through iptables to block all incoming packets ...  

best regards,

F H-C


Le Mardi 6 décembre 2016 11h10, Mandar Joshi [via GStreamer-devel] <[hidden email]> a écrit :


>
> are there known problems related to gst-rtsp that could explain this ?
>

henryco,
Gmail is classifying all your messages as spam. That's why I didn't
get any of your posts. I haven't had a chance to go through your
entire thread yet.

Anyway, I just wanted to quickly add that I've used Logitech C310 with
Raspberry Pi 2 with omxh264enc and gst-rtsp-server.

I just tested the following pipeline and it works well.
Note: I've modified the test-launch example to bind to eth0
(192.168.1.202) using gst_rtsp_media_factory_set_launch (factory,
argv[1]);

GST_DEBUG=3 ./test-launch "( v4l2src device=/dev/video0 !
video/x-raw,width=960,height=720,format=I420,framerate=30/1 !
omxh264enc ! video/x-h264,profile=high ! rtph264pay name=pay0 pt=96
config-interval=1 )" 192.168.1.202

GST_DEBUG=3 gst-launch-1.0 rtspsrc
location=rtsp://192.168.1.202:8556/test ! rtph264depay ! avdec_h264 !
xvimagesink sync=false

Regards
Mandar Joshi
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



If you reply to this email, your message will be added to the discussion below:
http://gstreamer-devel.966125.n4.nabble.com/can-t-stream-webcam-logitech-c310-tp4681011p4681035.html
To unsubscribe from can't stream webcam logitech c310, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
In reply to this post by Mandar Joshi
Hello again

No firewall active on raspbian but anyway i have just noticed that for another test-launch which source is the picam instead 
of webcam a gst-launch-1.0 rtspsrc ... is not able to connect to it even though i can connect to it (and see the video) 
with the zoneminder  software. ... i have version 1.4.3 of gstreamer client side and 1.4.4 serveur side... wondering if 
this could be the issue ...

regards

F

don't know why my emails are spammed, may be because i did not really subscribe to the mail-list 


Le Mardi 6 décembre 2016 11h10, Mandar Joshi [via GStreamer-devel] <[hidden email]> a écrit :


>
> are there known problems related to gst-rtsp that could explain this ?
>

henryco,
Gmail is classifying all your messages as spam. That's why I didn't
get any of your posts. I haven't had a chance to go through your
entire thread yet.

Anyway, I just wanted to quickly add that I've used Logitech C310 with
Raspberry Pi 2 with omxh264enc and gst-rtsp-server.

I just tested the following pipeline and it works well.
Note: I've modified the test-launch example to bind to eth0
(192.168.1.202) using gst_rtsp_media_factory_set_launch (factory,
argv[1]);

GST_DEBUG=3 ./test-launch "( v4l2src device=/dev/video0 !
video/x-raw,width=960,height=720,format=I420,framerate=30/1 !
omxh264enc ! video/x-h264,profile=high ! rtph264pay name=pay0 pt=96
config-interval=1 )" 192.168.1.202

GST_DEBUG=3 gst-launch-1.0 rtspsrc
location=rtsp://192.168.1.202:8556/test ! rtph264depay ! avdec_h264 !
xvimagesink sync=false

Regards
Mandar Joshi
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



If you reply to this email, your message will be added to the discussion below:
http://gstreamer-devel.966125.n4.nabble.com/can-t-stream-webcam-logitech-c310-tp4681011p4681035.html
To unsubscribe from can't stream webcam logitech c310, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: can't stream webcam logitech c310

henryco
My mistake! i have actually two webcams, one of which is c270 instead of c310, and i did not take care of this. Your sender pipeline works, but i find strange that the I420 format was not listed among supported formats by v4l2-ctl --list-formats ! it allows to reach much higher framerate than YUY2 ... don't know how i could have guessed this.