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

Add native support for the Raspberry Pi camera #1057

Merged
merged 1 commit into from Aug 15, 2022
Merged

Add native support for the Raspberry Pi camera #1057

merged 1 commit into from Aug 15, 2022

Conversation

aler9
Copy link
Member

@aler9 aler9 commented Jul 28, 2022

Fixes #1011

Fixes #1010

@aler9 aler9 force-pushed the rpicamera branch 2 times, most recently from 0640517 to 36b9341 Compare August 4, 2022 19:13
@aler9 aler9 force-pushed the rpicamera branch 10 times, most recently from 3638b27 to 8b2fbc1 Compare August 11, 2022 13:36
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2022

Codecov Report

Merging #1057 (2f45415) into main (f952ff2) will decrease coverage by 0.59%.
The diff coverage is 28.12%.

@@            Coverage Diff             @@
##             main    #1057      +/-   ##
==========================================
- Coverage   65.58%   64.98%   -0.60%     
==========================================
  Files          89       90       +1     
  Lines        7537     7606      +69     
==========================================
  Hits         4943     4943              
- Misses       2172     2241      +69     
  Partials      422      422              
Impacted Files Coverage Δ
internal/conf/path.go 16.66% <0.00%> (-2.14%) ⬇️
internal/core/rpicamera_source.go 0.00% <0.00%> (ø)
internal/core/source_static.go 73.58% <57.14%> (-11.42%) ⬇️
internal/core/api.go 75.32% <100.00%> (+0.65%) ⬆️
internal/core/path.go 72.60% <100.00%> (-0.11%) ⬇️
internal/core/path_manager.go 92.20% <0.00%> (+0.45%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@aler9 aler9 force-pushed the rpicamera branch 6 times, most recently from 4771f59 to c4a4940 Compare August 13, 2022 16:21
@aler9 aler9 changed the title Add native support for the Raspberry PI camera Add native support for the Raspberry Pi camera Aug 14, 2022
@aler9 aler9 force-pushed the rpicamera branch 4 times, most recently from a530a1a to 2f45415 Compare August 14, 2022 11:37
@aler9 aler9 merged commit 27b078d into main Aug 15, 2022
@aler9 aler9 deleted the rpicamera branch August 15, 2022 15:37
@cedricve
Copy link

@aler9 any idea when this will be made available on Docker hub?

@aler9
Copy link
Member Author

aler9 commented Aug 16, 2022

@cedricve the Docker version doesn't support the RPI camera natively, but the standard version does. Just take a look at the README in order to try the feature.

@cedricve
Copy link

cedricve commented Aug 16, 2022 via email

@aler9
Copy link
Member Author

aler9 commented Aug 16, 2022

This PR allows the server to interact with libcamera natively, skipping all the Gstreamer stack. GStreamer is not needed anymore.

The Docker version may come in the future, but I have to check whether the camera can be accessed from a container.

@cedricve
Copy link

cedricve commented Aug 16, 2022 via email

@olokos
Copy link

olokos commented Aug 17, 2022

Looks awesome, good job!

https://github.com/aler9/rtsp-simple-server/pull/1057/files#diff-fc943529e712158406c15ccb0d56f2afcd02a8d98a193c7623885e3d33366abdR4

I was wondering about those parameters, are there plans to support all of the native parameters with 1:1 names?
There's around 40 parameters or more for libcamera-vid --help

I was thinking, maybe instead of hardcoding parameters for libcamera-vid, some kind of wrapper approach could be used instead?

Right now it seems like most of true native Raspberry Pi Camera features/parameters are in fact unavailable, to some degree, but I might be completely wrong. :)

IIRC the bitrate is VBR by default for libcamera

@olokos
Copy link

olokos commented Aug 17, 2022

In terms of accessing host device from within docker container, that is possible!
https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device

@aler9
Copy link
Member Author

aler9 commented Aug 22, 2022

I opened two enhancement request in order to track the two features requested by @cedricve and @olokos :

#1110 Allow to use the Raspberry Camera with Docker

#1111 Allow to set additional parameters of the Raspberry Pi Camera

Discussion will be moved there.

@bluenviron bluenviron locked as resolved and limited conversation to collaborators Aug 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement native support for the Raspberry Pi Camera Using libcamera-vid
4 participants