v4l2src lost frames on raspberrypi zero wifi

Antonio Ospite ao2 at ao2.it
Thu Oct 11 07:46:49 UTC 2018


On Thu, 11 Oct 2018 09:53:32 +0800
Dengke Du <dengke.du at windriver.com> wrote:

> On 2018年10月10日 21:13, Nicolas Dufresne wrote:
[...]
> > > You are doing capture, software decode, software encode on a single
> > > thread, on the slowest PI. You should look forward using raw
> > > capture and omxh264enc, or doing directly encoded capture using
> > > rpicamsrc.
[...]
> So using the USB camera on raspberry pi zero wifi was a bad choice.
> 

As Nicolas already said, try to avoid all the software decoding and
encoding.

This means:

1. Instead of MJPEG, use raw video from the webcam, it supports it, this
   removes the need for jpeg decoding. A pixelformat conversion from
   YUYV to one accepted by the encoder could still be needed but it
   should be faster than JPEG decoding. (Check if USB bandwidth becomes
   a problem, tho).

2. Instead of x264enc, which is the element which uses the most CPU, try
   the hardware accelerated alternatives like omxh264enc, and if it is
   not available on your installation, look up how to install it and
   configure it (e.g. GPU RAM settings).

The pipeline becomes something like:

test-launch "( v4l2src ! video/x-raw ! queue ! videoconvert ! omxh264enc ! rtph264pay name=pay0 pt=96 )"

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the gstreamer-devel mailing list