Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcamera support for v4l2rtspserver #283

Open
madison8935 opened this issue Jun 15, 2022 · 11 comments
Open

libcamera support for v4l2rtspserver #283

madison8935 opened this issue Jun 15, 2022 · 11 comments
Labels

Comments

@madison8935
Copy link

Hi there,

i'm using v4l2rtspserver for mobile video streaming from raspberrypi zero2w (Bullseye, H264) into a milestone VMS system. Low latency and reliability are the highest priorities. To my question:

I would like to use the new ArduCam Cameras (imx519), which only work with libcamera. Will v4l2rtspserver work with libcamera soon, or is there a way to pipe trough the libcamera-vid to a virtual device, which can be processed by v4l2rtspserver?

I like to apologize in advance for wierd questions, as i just started with linux and raspberrypi's. Thank you for your work and support!

@mpromonet
Copy link
Owner

Hi,

I never used libcamera, but it seems to have a compability layer exposing a V4L2 device.
Did you try with:

  LD_PRELOAD=/usr/lib/arm-linux-gnueabihf/v4l2-compat.so

Best Regards,
Michel.

@cedricve
Copy link

Hey @mpromonet I did try that but didnt work out.

pi@kerberos:~ $ v4l2rtspserver -W 640 -H 480 -F 15 -P 8554 /dev/video0
log level:500

[NOTICE] /home/pi/v4l2rtspserver/main.cpp:297
  Version: 0.3.3-8-gb007df2 live555 version:2022.06.16
[NOTICE] /home/pi/v4l2rtspserver/src/V4l2RTSPServer.cpp:37
  Create V4L2 Source.../dev/video0
[NOTICE] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:133
  driver:unicam capabilities:a5a00001 mandatory:4000001
[NOTICE] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:136
  /dev/video0 support capture
[NOTICE] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:138
  /dev/video0 support read/write
[NOTICE] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:139
  /dev/video0 support streaming
[ERROR] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:212
  /dev/video0: Cannot set pixelformat to:H264 format is:YUYV
[ERROR] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:212
  /dev/video0: Cannot set pixelformat to:MJPG format is:YUYV
[ERROR] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:212
  /dev/video0: Cannot set pixelformat to:JPEG format is:YUYV
[ERROR] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2Device.cpp:83
  Cannot init device:/dev/video0
[NOTICE] /home/pi/v4l2rtspserver/v4l2wrapper/src/V4l2MmapDevice.cpp:141
VIDIOC_STREAMOFF: Bad file descriptor
VIDIOC_REQBUFS: Bad file descriptor
  Device /dev/video

@azsde
Copy link
Contributor

azsde commented Jul 18, 2022

Using libcamera would be awesome, I have the exact same usecase.

@Tormund1985
Copy link

Using libcamera would be awesome, I have the exact same usecase.

It would be great, because all the new cams are only supported with libcamera.

@mpromonet
Copy link
Owner

mpromonet commented Jul 20, 2022

Hi,

You may submit pull request implementing this. This project use a standard interface V4L2, using a library is an approach, that I don't find interesting. It may be better to use a V4L2 device feed with libcamera.

Best Regards,
Michel.

@azsde
Copy link
Contributor

azsde commented Jan 9, 2023

Hello @mpromonet, as of today, the new official raspberry camera V3 has been released, they are not compatible with the old camera stack and only are compatible with libcamera.

I assume the old V2 camera are going to be discontinued, do you plan to add support for the newer cameras (and thus libcamera support) ?

@krytie75
Copy link

Also would very much like to see libcamera support for the new camera V3. A very nice upgrade from the V2 and I would like to switch several of my cameras out to this version.

I'll take the opportunity to thank @mpromonet for this wonderful tool which I have only recently started using, I have high hopes to be able to keep using it with the new camera module!

@carljokl
Copy link

I am curious as to how difficult the change would be to implement. If someone knows C/C++. Would it require very deep knowledge of video and Linux technology or can a mere mortal attempt the change?

@azsde
Copy link
Contributor

azsde commented Jan 20, 2023

It seems there a wrapper called libcamerify available in libcamera-tools (sudo apt install libcamera-tools) that allows v4l2rtspserver to work with the new cameras supported by libcamera, however i can't get the stream to play with VLC nor ffplay :(

See issue: #297

@Tormund1985
Copy link

Tormund1985 commented Feb 3, 2023

I have exactly the same problem, apparently is working fine but I can't open it with VLC nor ffplay...

@Tormund1985
Copy link

Hi again, there are any new about how to use the wrapper libcamerify to get it work with bullseye? many thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants