From 1dc90dad7a50dcbac374e531632ed8a8c0d5bb6f Mon Sep 17 00:00:00 2001 From: Felicia Hummel Date: Fri, 12 Feb 2021 00:06:03 +0100 Subject: [PATCH 1/3] Give `V4L2_PIX_FMT_MJPEG` an unique name This patch gives `V4L2_PIX_FMT_MJPEG` an unique name. Previously, `V4L2_PIX_FMT_MJPEG` would be chosen instead of `V4L2_PIX_FMT_JPEG` if `JPEG` was specified on the command line. Relates to issue #40 --- src/ustreamer/device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ustreamer/device.c b/src/ustreamer/device.c index cf3436a..3047c5b 100644 --- a/src/ustreamer/device.c +++ b/src/ustreamer/device.c @@ -41,7 +41,7 @@ static const struct { {"UYVY", V4L2_PIX_FMT_UYVY}, {"RGB565", V4L2_PIX_FMT_RGB565}, {"RGB24", V4L2_PIX_FMT_RGB24}, - {"JPEG", V4L2_PIX_FMT_MJPEG}, + {"MJPEG", V4L2_PIX_FMT_MJPEG}, {"JPEG", V4L2_PIX_FMT_JPEG}, }; From b7501cfbdad496fb7dbb2515e4fa4a4fdb32637d Mon Sep 17 00:00:00 2001 From: Felicia Hummel Date: Fri, 12 Feb 2021 00:17:06 +0100 Subject: [PATCH 2/3] Add MJPEG to FORMATS_STR Add missing MJPEG option to FORMATS_STR --- src/ustreamer/device.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ustreamer/device.h b/src/ustreamer/device.h index 250d202..b257f7c 100644 --- a/src/ustreamer/device.h +++ b/src/ustreamer/device.h @@ -64,7 +64,7 @@ #define STANDARDS_STR "PAL, NTSC, SECAM" #define FORMAT_UNKNOWN -1 -#define FORMATS_STR "YUYV, UYVY, RGB565, RGB24, JPEG" +#define FORMATS_STR "YUYV, UYVY, RGB565, RGB24, MJPEG, JPEG" #define IO_METHOD_UNKNOWN -1 #define IO_METHODS_STR "MMAP, USERPTR" From 185a8b6773f978b1f78fa785bdb7e5d61b3b78f0 Mon Sep 17 00:00:00 2001 From: Felicia Hummel Date: Wed, 17 Feb 2021 11:48:16 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index a33d1d9..2a2ca04 100644 --- a/README.md +++ b/README.md @@ -77,6 +77,24 @@ $ ./ustreamer \ You can always view the full list of options with ```ustreamer --help```. +----- +# Raspberry Pi Camera Example + +Example usage for the Raspberry Pi v1 camera: + +```bash +$ sudo modprobe bcm2835-v4l2 +$ ./ustreamer --host :: -m jpeg --device-timeout=5 --buffers=3 -r 2592x1944 +``` + +:exclamation: Please note that newer camera models have a different maximum resolution. You can see the supported resolutions at the [PiCamera documentation](https://picamera.readthedocs.io/en/release-1.13/fov.html#sensor-modes) + +:exclamation: If you get a poor framerate, it could be that the camera is switched to photo mode, which produces a low framerate (but a higher quality picture). This is because `bcm2835-v4l2` switches to photo mode at resolutions higher than `1280x720`. To work around this, pass the `max_video_width` and `max_video_height` module parameters like so: + +```bash +$ modprobe bcm2835-v4l2 max_video_width=2592 max_video_height=1944 +``` + ----- # See also * [Running uStreamer via systemd service](https://github.com/pikvm/ustreamer/issues/16).