v4l2rtspclient icon indicating copy to clipboard operation
v4l2rtspclient copied to clipboard

VIDIOC_REQBUFS: Inappropriate ioctl for device

Open sithdaddy opened this issue 4 years ago • 3 comments

so i run v4l2rtspclient like this...

sudo v4l2rtspclient rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp?real_stream

This url works fine with vlc.

what is causing this message at the end "VIDIOC_REQBUFS: Inappropriate ioctl for device" ?

i get this...

sudo v4l2rtspclient -vvv rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp?real_stream 2019-02-14 05:51:09,017 [INFO ] - libv4l2cpp/inc/logger.h:44 level:DEBUG Created new TCP socket 3 for connection Connecting to 192.168.10.2, port 554 on socket 3... ...remote connection opened Sending request: DESCRIBE rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp?real_stream RTSP/1.0 CSeq: 2 User-Agent: LIVE555 Streaming Media v2019.12.05 Accept: application/sdp

Received 644 new bytes of response data. Received a complete DESCRIBE response: RTSP/1.0 200 OK Content-Type: application/sdp Server: H264DVR 1.0 Cseq: 2 Content-Base: rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp/ Cache-Control: private x-Accept-Retransmit: our-retransmit x-Accept-Dynamic-Rate: 1 Content-Length: 364

v=0 o=- 38990265062388 38990265062388 IN IP4 192.168.10.2 s=RTSP Session c=IN IP4 192.168.10.2 t=0 0 a=control:* a=range:npt=0- m=video 0 RTP/AVP 96 a=rtpmap:96 H264/90000 a=range:npt=0- a=framerate:0S a=fmtp:96 profile-level-id=64001f; packetization-mode=1; sprop-parameter-sets=Z2QAH6wsaoFAFum4CAgIEA==,aO48sA== a=framerate:25 a=control:trackID=3

Sending request: SETUP rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp/trackID=3 RTSP/1.0 CSeq: 3 User-Agent: LIVE555 Streaming Media v2019.12.05 Transport: RTP/AVP;unicast;client_port=59192-59193

Received 243 new bytes of response data. Received a complete SETUP response: RTSP/1.0 200 OK Server: H264DVR 1.0 Cseq: 3 Session: 217228060;timeout=60 Transport: RTP/AVP;unicast;mode=PLAY;source=192.168.10.2;client_port=59192-59193;server_port=40000-40001;ssrc=00001BCC Cache-Control: private x-Dynamic-Rate: 1

Start playing sink for "video/H264" subsession markerSize:4 Sending request: PLAY rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp/ RTSP/1.0 CSeq: 4 User-Agent: LIVE555 Streaming Media v2019.12.05 Session: 217228060 Range: npt=0.000-

Received 86 new bytes of response data. Received a complete PLAY response: RTSP/1.0 200 OK Server: H264DVR 1.0 Cseq: 4 Range: npt=now- Session: 217228060

2019-02-14 05:51:09,223 [DEBUG ] - src/v4l2writer.cpp:61 NAL:7 2019-02-14 05:51:09,226 [NOTICE] - src/v4l2writer.cpp:67 geometry:1280x720 VIDIOC_REQBUFS: Inappropriate ioctl for device NOTIFY failed NOTIFY failed NOTIFY failed .... ....

sithdaddy avatar Apr 07 '21 21:04 sithdaddy

My colleague suggested this solution to me. I had to use v4l2loopback to create a loopback device and point v4l2rtspclient to use that video source created by v4l2loopback.

I am not sure if that is the way it is supposed to be by design or if it is some other kind of issue.

sudo modprobe v4l2loopback video_nr=1

sudo v4l2rtspclient rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp?real_stream /dev/video1

EDIT :

I tried again and couldn't replicate it. must have been a fluke.

sithdaddy avatar Apr 10 '21 15:04 sithdaddy

Hi @sithdaddy

I did not answer because you did not explain what you try to do. v4l2rtspclient connect to an RTSP H264 video stream and write to an V4L2 device with H264 format, so if /dev/video1 (the default device used) doesnot exist and is not a V4L2 device supporting H264 it will not do anything....

Best Regards, Michek.

mpromonet avatar Apr 10 '21 17:04 mpromonet

Hello Michek.

I am trying to open an RTSP stream and use it like a V4L2 device where i can adjust parameters like brightness , contrast , color saturation with v4l2-ctl . I am not sure if v4l2rtspclient is able to do that though.

I am not sure i understand you right. Does one need any kind of device , like a webcam or a PI camera and then use v4l2rtspclient and send the output from v4l2rtspclient to that device or are you talking about a virtual device like v4l2loopback ?

could you please list me the steps i would need to take to make it work ?

As you can see from my original post , i installed v4l2loopback and then i did...

sudo modprobe v4l2loopback video_nr=1 , in order to create a V4L2 device.

Then i started sudo v4l2rtspclient rtsp://192.168.10.2:554/user=admin_password=5HCriNdj_channel=1_stream=0.sdp?real_stream /dev/video1

And then i used VLC to open the video1 device.

I am not sure if that is all it takes. The odd thing is that could make this work only once , the second time it didnt work anymore.

Regards sithdaddy

sithdaddy avatar Apr 10 '21 20:04 sithdaddy