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

Failure in documentation: CAMERA : GSTREAMER : RPT #4040

Closed
Kletternaut opened this issue Feb 28, 2025 · 10 comments
Closed

Failure in documentation: CAMERA : GSTREAMER : RPT #4040

Kletternaut opened this issue Feb 28, 2025 · 10 comments

Comments

@Kletternaut
Copy link

Kletternaut commented Feb 28, 2025

This is basically a copy'n paste from the documentation
https://www.raspberrypi.com/documentation/computers/camera_software.html#rtp

$ rpicam-vid -t 0 -n --inline -o - | gst-launch-1.0 fdsrc fd=0 ! h264parse ! rtph264pay ! udpsink host=127.0.0.1 port=5555

---------------------------------^

and it results in this error message:
[NULL @ 0x5555a1fc9e00] Unable to find a suitable output format for '-'

also from https://www.raspberrypi.com/documentation/computers/camera_software.html#libcamerasrc-gstreamer-element

gst-launch-1.0 libcamerasrc ! capsfilter caps=video/x-raw,width=1280,height=720,format=NV12 ! v4l2convert ! v4l2h264enc extra-controls="controls,repeat_sequence_header=1" ! 'video/x-h264,level=(string)4.1' ! h264parse ! rtph264pay ! udpsink host=<ip-addr> port=<port>

and it results in this error message:
WARNUNG: Fehlerhafte Leitung: Kein Element »v4l2convert«
'sorry' its German.

system informations:

--------------------------------------------------------------------------------
Hardware information
--------------------------------------------------------------------------------
Revision	: d04170
Model		: Raspberry Pi 5 Model B Rev 1.0
--------------------------------------------------------------------------------
Cameras
--------------------------------------------------------------------------------
0 : imx477 [4056x3040 12-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@88000/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [120.05 fps - (696, 528)/2664x1980 crop]
           'SRGGB12_CSI2P' : 2028x1080 [50.03 fps - (0, 440)/4056x2160 crop]
                             2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

1 : imx477 [4056x3040 12-bit RGGB] (/base/axi/pcie@120000/rp1/i2c@80000/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [120.05 fps - (696, 528)/2664x1980 crop]
           'SRGGB12_CSI2P' : 2028x1080 [50.03 fps - (0, 440)/4056x2160 crop]
                             2028x1520 [40.01 fps - (0, 0)/4056x3040 crop]
                             4056x3040 [10.00 fps - (0, 0)/4056x3040 crop]

--------------------------------------------------------------------------------
Versions
--------------------------------------------------------------------------------
** uname -a **
Linux raspi5 6.12.15-v8-16k+ #1858 SMP PREEMPT Wed Feb 19 14:51:38 GMT 2025 aarch64 GNU/Linux

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"

** vcgencmd version **
2025/02/12 10:51:52 
Copyright (c) 2012 Broadcom
version f788aab6 (release) (embedded)

** rpicam-hello --version **
rpicam-apps build: v1.6.0 025ca84648c9 03-02-2025 (16:21:04)
rpicam-apps capabilites: egl:1 qt:1 drm:1 libav:1
libcamera build: v0.4.0+53-29156679

gst-inspect-1.0 version 1.22.0
GStreamer 1.22.0
@lurch
Copy link
Contributor

lurch commented Feb 28, 2025

ping @davidplowman and @naushir

@davidplowman
Copy link
Contributor

A lot of this documentation should be improved/fixed by #4019, so we should review it once that's been merged.

(There's no v4l2convert element on a Pi 5, which is why it would fail.)

@Kletternaut
Copy link
Author

A lot of this documentation should be improved/fixed by #4019, so we should review it once that's been merged.

(There's no v4l2convert element on a Pi 5, which is why it would fail.)

The commit #4019 again contains this error, or similar (no element: v4l2h264enc).

https://github.com/raspberrypi/documentation/pull/4019/files#diff-e43d00f7e68e986794066776f6e921e27518b5a2deb9ecaeccac094529341cf3

Line 139:

$ gst-launch-1.0 libcamerasrc ! capsfilter caps=video/x-raw,width=640,height=360,format=NV12,interlace-mode=progressive ! v4l2h264enc extra-controls="controls,repeat_sequence_header=1" ! 'video/x-h264,level=(string)4' ! h264parse ! mpegtsmux ! udpsink host=<ip-addr> port=<port>

admin@raspi5:~ $ gst-launch-1.0 libcamerasrc ! capsfilter caps=video/x-raw,width=640,height=360,format=NV12,interlace-mode=progressive ! v4l2h264enc extra-controls="controls,repeat_sequence_header=1" ! 'video/x-h264,level=(string)4' ! h264parse ! mpegtsmux ! udpsink host=127.0.0.1 port=5555 WARNUNG: Fehlerhafte Leitung: Kein Element »v4l2h264enc«

@Kletternaut
Copy link
Author

This is also wrong
Line 135:

libcamera provides a libcamerasrc GStreamer element which can be used directly instead of rpicam-vid. To use this element, run the following command on the server, replacing the <ip-addr> placeholder with the IP address of the client or multicast address and replacing the <port> placeholder with the port you would like to use for streaming. On a Pi 4 or earlier device, use:

This is wrong, at least literally, because it is not and drives users like me crazy! It's such an incredible mess with this whole camera software thing. You cannot use libcamerasrc as a replacement ( ...'can be used directly instead of rpicam-vid...)

If the above is true, how can I use

'rpicam-vid option --info-text %focus'

in libcamerasrc? This is a very urgent problem and question for me at the moment and was already an discused issue here:
raspberrypi/libcamera#241

@naushir
Copy link
Contributor

naushir commented Feb 28, 2025

This is wrong, at least literally, because it is not and drives users like me crazy! It's such an incredible mess with this whole camera software thing. You cannot use libcamerasrc as a replacement ( ...'can be used directly instead of rpicam-vid...)

Nobody said libcamerasrc is a like-for-like replacement for rpicam-vid - it's clearly not in all levels of functionality. In that particular example, it can be though.

Please let's not have this issue degrade into a rant.

@davidplowman
Copy link
Contributor

The commit #4019 again contains this error, or similar (no element: v4l2h264enc).

https://github.com/raspberrypi/documentation/pull/4019/files#diff-e43d00f7e68e986794066776f6e921e27518b5a2deb9ecaeccac094529341cf3

Line 139:

$ gst-launch-1.0 libcamerasrc ! capsfilter caps=video/x-raw,width=640,height=360,format=NV12,interlace-mode=progressive ! v4l2h264enc extra-controls="controls,repeat_sequence_header=1" ! 'video/x-h264,level=(string)4' ! h264parse ! mpegtsmux ! udpsink host=<ip-addr> port=<port>

True, though the line immediately below does say this:

On a Pi 5 you would have to replace v4l2h264enc extra-controls="controls,repeat_sequence_header=1" by x264enc speed-preset=1 threads=1.

Of course if the documentation update had been merged then it would be a bit more readable, so my apologies that that hasn't yet happened. We're of course very happy to try and improve the formatting where that would help.

@Kletternaut
Copy link
Author

Please let's not have this issue degrade into a rant.

No, it's certainly not my intention, on the contrary, I want to help, that's why I opened this ticket. I wanted to express the fact that I have been researching everywhere for months to find a solution to “my problem”. And that's where the depths have opened up... i really have no idea about this stuff and have even read your commits from 2020 :-)

True, though the line immediately below does say this:
On a Pi 5 you would have to replace v4l2h264enc extra-controls="controls,repeat_sequence_header=1" by x264enc speed-preset=1 threads=1.

Of course if the documentation update had been merged then it would be a bit more readable, so my apologies that that hasn't yet happened. We're of course very happy to try and improve the formatting where that would help.

Oh, thanks, I didn't see that. But I tested it straight away...

gst-launch-1.0 libcamerasrc camera-name=/base/axi/pcie@120000/rp1/i2c@88000/imx477@1a ! capsfilter caps=video/x-raw,width=640,height=480,format=NV12,interlace-mode=progressive ! x264enc speed-preset=1 threads=1 ! 'video/x-h264,level=(string)4' ! h264parse ! mpegtsmux ! udpsink host=127.0.0.1 port=5555

WARNUNG: Von Element /GstPipeline:pipeline0/GstUDPSink:udpsink0: Die Zusammensetzung der Leitung ist ungültig. Bitte fügen Sie Warteschlangen hinzu.
Zusätzliche Fehlerdiagnoseinformation:

../libs/gst/base/gstbasesink.c(1249): gst_base_sink_query_latency (): /GstPipeline:pipeline0/GstUDPSink:udpsink0:
Not enough buffering available for  the processing deadline of 0:00:00.020000000, add enough queues to buffer  0:00:00.020000000 additional data. Shortening processing latency to 0:00:00.000000000.

Execution ended after 0:00:04.257309510

@Kletternaut
Copy link
Author

So wie es für mich aussieht habt ihr gar kein Interesse daran, wenn euch jemand auf Probleme oder Fehler hinweist.

Ich muss mich als Benutzer und somit Kunde von raspberrypi Hard-und Software dafür entschuldigen, auf Fehler und Probleme hinzuweisen?? Ich schliesse das Ticket deshalb, war dann mit Sicherheit auch mein letztes.

@davidplowman
Copy link
Contributor

Hi again, I'm very sorry about that. I always want to try and help, but the unfortunate fact of the matter is that we aren't involved in the gstreamer element development, and there's simply not much we can suggest. If you need support with it, you would have to get in touch with the folks who develop it.

I don't know if it's a hard requirement for you to use gstreamer - I understand if it is - but if not then I'd be very happy to give you my best advice over on the Picamera2 issue board. Be sure to list your requirements in terms of images and resolutions, the processing that you want to do with them, and how you need to stream or output the results. Thanks.

@Kletternaut
Copy link
Author

You don't have anything to apologize for, please. I have one question, how do you translate the German word for "Durcheinander"? I just saw that "total mess" can also be translated as German word "totale Sauerei". That was not meant that way!!! and a translation error on my part! What I meant and wanted to say was disorder (German: Unordnung). Please excuse Mr. Naushir and everyone who felt addressed.

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

No branches or pull requests

4 participants