I have been playing around with Pi 4 for a few weeks using ffmpeg to grab still images and videos from an IP camera using an RTSP stream. Everything is working but now i want to take it to the next level and get a live feed working.
vlc, motion, motioneye etc. work but they kill the cpu which goes up to 200% when the apps are streaming. I eventually worked out that this is because it is being re-encoded from MJPEG to h264.
I have been writing on forums and getting some advice, and i've been told to try gstreamer in combination with streameye to take the RTSP feed from the camera and pass it to streameye which is a simple MJPEG http server. In theory, this should take the RTSP feed, keep it in its native MJPEG format and pass it to the http server. It should run without killing the cpu.
But the problem is - i can't seem to get gstreamer working properly. I can't even run a test page. When i run the below code i'm getting errors:
Code: Select all
gst-launch-1.0 videotestsrc ! videoconvert ! autovideosinkCan anyone suggest the right way to install gstreamer on a fresh pi 4 and then after that - the correct code to run in order to see a test pattern on the screen (ie. to prove gstreamer is working.
Thanks
FYI - this is the error:
Code: Select all
pi@raspberrypi:~ $ sudo gst-launch-1.0 videotestsrc ! videoconvert ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms: GStreamer error: negotiation problem.
Additional debug info:
gstkmssink.c(1059): gst_kms_sink_set_caps (): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstKMSSink:autovideosink0-actual-sink-kms:
failed to configure video mode
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...