1

Heads up: The goal of my project is to replace a regular Intel Core PC with a Raspberry Pi 4

I have a camera simulation that runs on a Intel PC pretty well. It takes MP4 files and encodes them into jpeg with jpegenc. Using GStreamer and its plugins, namely avdec_h264 and qtdemux this works pretty well. There is also an option to use the vaapih264dec and its jpeg encoder counterpart. This is useful because the CPU usage is super high using the non hardware optimized plugins. i.e. on the Pi this program works as well but with only 4 cameras we are at 100% usage on all 4 Kernels.

Now I have been researching quite a lot and the first answer was using omxh264dec since that is the vaapi counterpart for the RPi (or so I´m assuming). I cant get this to work and every time I try anything different the Pipeline simply wont build.

I have tried :

-Swapping the demuxer

-Changing the decoder and encoder (no combination other than the CPU using ones seemed to work)

-Asking on the GStreamer forum (was just told that it doesn't work that way, but got no clue as to where to start looking elsewhere)

-Even tried to build the pipeline without the whole program but even that doesn't seem to work with omxh264

Pipeline :

gst-launch-1.0 filesrc location=/home/pi/test.mp4 ! qtdemux ! h264parse ! omxh264dec ! autovideosink

gives this error :

Leitung wird auf PAUSIERT gesetzt ...  
Leitung läuft vor …                    
FEHLER: Von Element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Internal data s$
Zusätzliche Fehlerdiagnoseinformation:
qtdemux.c(6073): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux$
streaming stopped, reason not-negotiated (-4)

So my question is really : is it somehow possible to use Gstreamer and stream omxdecoded footage and if not how I can still use less CPU on my program so my RPi doesn't end up dying.

Hardy_J
  • 21
  • 3
  • It is not entirely clear to me what you want to do. From your gstreamer command line - I am guessing: You want to playback a local MP4 file with H.264 video on a Raspberry Pi. I am doing video related stuff on the Pi for sometime. Mostly C++ straight to OpenMAX (omx) - currently I have trouble running my software on a Pi 4. I would try on an older distro on a Pi 3B+. I'd use a distro that was made prior to the Pi4 release. You should be able to decode and view 1080p30 H.264 on any older Pi. – Markus Schumann Nov 25 '19 at 12:40
  • well yes and no. I am trying to decode the video on the rpi using the GPU and then sending it via udp. I am aware that you cant tell that in the gstreamer command but it is the intent in the end. I am using autovideosink for testing only. I am not factually limited to the pi 4 but having 4 kernels and 4gig ram is pretty much the only thing i can do for the program to run anywhere near as well as I am trying to accomplish. – Hardy_J Nov 25 '19 at 14:12
  • I assume you are running a GUI on the Pi? Perhaps a (auto)videoconvert before the sink helps? When in doubt set GST_DEBUG=3 or 4 to check for cap negotiation errors. – Florian Zwoch Nov 25 '19 at 18:36
  • @Hardy_J - You probably like the Pi 4 because of its 4 cores. But you are running only one kernel which is the Linux kernel - unless you are running some sort of VM. BTW the Raspberry Pi 3 Model B has also 4 cores. – Markus Schumann Nov 25 '19 at 19:50
  • @FlorianZwoch this is my GST_DEBUG 3 output https://imgur.com/917jMFZ – Hardy_J Nov 26 '19 at 07:25
  • @MarkusSchumann you are right I do need the Cores and I do need the 4 gigs of RAM in order to run this. The Pi 3 is unfortunately not an option – Hardy_J Nov 26 '19 at 07:27
  • Looks to me that either the file is broken or uses a H.264 Profile/Level spec not supported by the Pi's decoder chip. – Florian Zwoch Nov 26 '19 at 10:15
  • The file is definetly not at fault here I have tried with known accepted MP4 files and have gotten the same error. – Hardy_J Dec 02 '19 at 07:22

1 Answers1

0

Raspberry Pi supports only 1080p60 H.264 high-profile encode/decode. you can see test.mp4 profile with run this pipe in PC.

gst-launch-1.0 filesrc location=/home/pi/test.mp4 ! qtdemux ! h264parse ! avdec_h264 ! autovideosink -v
Babak Abgh
  • 11
  • 1
  • Unfortunately this is my issues. I do not want to use avdec_h264 since it uses the CPU so heavily. This Pipeline does work on the RPI, but I wanted to use omx decode. Is there any way to do that on the Raspberry Pi – Hardy_J Dec 02 '19 at 07:24
  • if your test.mp4 compressed with high-profile h264, don't have any way to decode with omxh264enc. – Babak Abgh Dec 02 '19 at 16:51