Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

skyline220
Hi All,

I was able to install the VAAPI based G-Streamer plugins on an Intel Kaby
Lake i5-7300U chip. To my surprise, I get only 1/3 the framerate with the
VAAPI JPEG decoding plugin as I do with the software plugins. Here is my
sender pipeline:

gst-launch-1.0 v4l2src device=/dev/video1 do-timestamp=true !
video/x-raw,format=I420,width=1920,height=1080,framerate=60/1 ! jpegenc !
rtpjpegpay ! multiudpsink clients=192.168.0.7:5000

Here is my receiver side pipeline where I attempt the VAAPI plugin and only
get 11 FPS:

gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 !
application/x-rtp,encoding-name=JPEG,payload=26,framerate=60/1,width=1920,height=1080
! rtpjpegdepay ! vaapijpegdecode ! fpsdisplaysink

Here is my receiver side pipeline where I attempt the software JPEG plugin
and I get 33FPS:

gst-launch-1.0 udpsrc port=5002 buffer-size=2000000 !
application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegdec !
videoconvert ! autovideosink

I also noticed I am not getting a full 60FPS in either pipeline, any idea
why that is?

Thanks




--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

Stephenwei
Hi,
Could you try to increase jpegparse between depay  and vaapijpegdecode?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

skyline220
Hi Stephen,

Thank you for your response. The sender pipeline is 1920x1080 @ 60FPS. After doing some testing here are my results with VAAPIjpegdec:

Pipeline (1) Vaapijpegdec:

gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay=true

yields 6.00 FPS 

Pipeline (2) With Vaapijpegdec and Jpegparse between depay and vaapijpegdec:

gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 ! application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay ! jpegparse ! vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay = true

yields 6.18 FPS 

So I get a slight improvement of 0.18 FPS,

Here are the GstShark analysis results:

GstShark Analysis Pipeline (1) without jpegparse:

Proctime Analysis




Element Time (ns) Time (ms)
capsfilter 8830 0.00883
rtpjpegdepay0 505782 0.505782
vaapijpegdec0 6017591 6.017591
videoconvert0 50351 0.050351

GstShark Analysis Pipeline (2) with jpegparse:

Proctime Analysis




Element Time (ns) Time (ms)
capsfilter 15244 0.015244
rtpjpegdepay0 608405 0.608405
jpegparse0 1589129 1.589129
vaapijpegdec0 3160754 3.160754
videoconvert0 68940 0.06894

It seems the vaapijpegdec is able to perform the decode in 3.16ms vs almost 17ms for the software decoder (jpegdec) yet the framerate is 12.14 FPS so almost double with the software decoder. Do you know why this could be?


On Sat, Dec 22, 2018 at 10:27 AM Stephenwei <[hidden email]> wrote:
Hi,
Could you try to increase jpegparse between depay  and vaapijpegdecode?



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

Wolfgang Grandegger
Hello Nihit,

I wonder why you do not use:

... rtpjpegdepay ! vaapijpegdec ! vaapipostproc ! vaapisink

Likely, this will not speed up "vaapijpegdec", but the following
elements will use hardware acceleration as well.

Also, "buffer-size" seems very small. Try a value 10 times bigger, or
even more. And did you increase network buffering on the receiver and
sender side using:

  # sysctl net.core.rmem_max=16777216
  # sysctl net.core.wmem_max=16777216

Hope it helps,

Wolfgang.

Am 26.12.18 um 02:14 schrieb Nihit Mody:

> Hi Stephen,
>
> Thank you for your response. The sender pipeline is 1920x1080 @
> 60FPS. After doing some testing here are my results with VAAPIjpegdec:
>
> Pipeline (1) Vaapijpegdec:
>
> gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 !
> application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay !
> vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay=true
>
> yields 6.00 FPS 
>
> Pipeline (2) With Vaapijpegdec and Jpegparse between depay and vaapijpegdec:
>
> gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 !
> application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay !
> jpegparse ! vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay = true
>
> yields 6.18 FPS 
>
> So I get a slight improvement of 0.18 FPS,
>
> Here are the GstShark analysis results:
>
> GstShark Analysis Pipeline (1) without jpegparse:
>
> Proctime Analysis
>
>
>
>
> Element Time (ns) Time (ms)
> capsfilter 8830 0.00883
> rtpjpegdepay0 505782 0.505782
> vaapijpegdec0 6017591 6.017591
> videoconvert0 50351 0.050351
>
>
> GstShark Analysis Pipeline (2) with jpegparse:
>
> Proctime Analysis
>
>
>
>
> Element Time (ns) Time (ms)
> capsfilter 15244 0.015244
> rtpjpegdepay0 608405 0.608405
> jpegparse0 1589129 1.589129
> vaapijpegdec0 3160754 3.160754
> videoconvert0 68940 0.06894
>
>
> It seems the vaapijpegdec is able to perform the decode in 3.16ms vs
> almost 17ms for the software decoder (jpegdec) yet the framerate is
> 12.14 FPS so almost double with the software decoder. Do you know why
> this could be?
>
>
> On Sat, Dec 22, 2018 at 10:27 AM Stephenwei <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi,
>     Could you try to increase jpegparse between depay  and vaapijpegdecode?
>
>
>
>     --
>     Sent from: http://gstreamer-devel.966125.n4.nabble.com/
>     _______________________________________________
>     gstreamer-devel mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Gstreamer VAAPI decoder plugins run much slower than software decoder plugins

Xiang, Haihao

Hi Nihit,

Usually retrieving video data from a video buffer is very slow, so it would be
better to use hardware acceleration in downstream elements too.

Thanks
Haihao

> Hello Nihit,
>
> I wonder why you do not use:
>
> ... rtpjpegdepay ! vaapijpegdec ! vaapipostproc ! vaapisink
>
> Likely, this will not speed up "vaapijpegdec", but the following
> elements will use hardware acceleration as well.
>
> Also, "buffer-size" seems very small. Try a value 10 times bigger, or
> even more. And did you increase network buffering on the receiver and
> sender side using:
>
>   # sysctl net.core.rmem_max=16777216
>   # sysctl net.core.wmem_max=16777216
>
> Hope it helps,
>
> Wolfgang.
>
> Am 26.12.18 um 02:14 schrieb Nihit Mody:
> > Hi Stephen,
> >
> > Thank you for your response. The sender pipeline is 1920x1080 @
> > 60FPS. After doing some testing here are my results with VAAPIjpegdec:
> >
> > Pipeline (1) Vaapijpegdec:
> >
> > gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 !
> > application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay !
> > vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay=true
> >
> > yields 6.00 FPS
> >
> > Pipeline (2) With Vaapijpegdec and Jpegparse between depay and vaapijpegdec:
> >
> > gst-launch-1.0 udpsrc port=5000 buffer-size=2000000 !
> > application/x-rtp,encoding-name=JPEG,payload=26 ! rtpjpegdepay !
> > jpegparse ! vaapijpegdec ! videoconvert ! fpsdisplaysink text-overlay = true
> >
> > yields 6.18 FPS
> >
> > So I get a slight improvement of 0.18 FPS,
> >
> > Here are the GstShark analysis results:
> >
> > GstShark Analysis Pipeline (1) without jpegparse:
> >
> > Proctime Analysis
> >
> >
> >
> >
> > Element Time (ns) Time (ms)
> > capsfilter 8830 0.00883
> > rtpjpegdepay0 505782 0.505782
> > vaapijpegdec0 6017591 6.017591
> > videoconvert0 50351 0.050351
> >
> >
> > GstShark Analysis Pipeline (2) with jpegparse:
> >
> > Proctime Analysis
> >
> >
> >
> >
> > Element Time (ns) Time (ms)
> > capsfilter 15244 0.015244
> > rtpjpegdepay0 608405 0.608405
> > jpegparse0 1589129 1.589129
> > vaapijpegdec0 3160754 3.160754
> > videoconvert0 68940 0.06894
> >
> >
> > It seems the vaapijpegdec is able to perform the decode in 3.16ms vs
> > almost 17ms for the software decoder (jpegdec) yet the framerate is
> > 12.14 FPS so almost double with the software decoder. Do you know why
> > this could be?
> >
> >
> > On Sat, Dec 22, 2018 at 10:27 AM Stephenwei <[hidden email]
> > <mailto:[hidden email]>> wrote:
> >
> >     Hi,
> >     Could you try to increase jpegparse between depay  and vaapijpegdecode?
> >
> >
> >
> >     --
> >     Sent from: http://gstreamer-devel.966125.n4.nabble.com/
> >     _______________________________________________
> >     gstreamer-devel mailing list
> >     [hidden email]
> >     <mailto:[hidden email]>
> >     https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> >
> >
> > _______________________________________________
> > gstreamer-devel mailing list
> > [hidden email]
> > https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
> >
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel