pixelated macro-blocks on videosink with hardware-acceleration

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

pixelated macro-blocks on videosink with hardware-acceleration

Saurabh Bora
Hi Experts, 

I have a gstreamer pipeline to send VP8 encoded data using hardware acceleration:
videotestsrc is-live=yes ! aspectratiocrop aspect-ratio=4/3 ! vaapivp8enc ! rtpvp8pay !application/x-rtp,media=video,encoding-name=VP8,payload=96  ! udpsink host-127.0.0.1 port=5000

On the other hand, following pipeline is used to decode the data and display on a videosink:
udpsrc port=5000 caps = "application/x-rtp, media=video, clock-rate=90000, encoding-name=VP8, payload=96" ! rtpvp8depay ! decodebin ! videoconvert ! autovideosink

When a specific event happens, I change the "aspect-ratio" property on "aspectratiocrop" element to 1/1. I achieve this by using below code:

  GstElement* cropStream = gst_bin_get_by_name(GST_BIN(pipeline), "aspectRatio");
  if (cropStream == NULL)
  {
      return -1;
  }
  //Set aspect-ratio property as 1/1.
  g_object_set(cropStream, "aspect-ratio", 1, 1, NULL);


The property is successfully changed and aspect ratio changes to "1/1". However, for a second or so, macro-blocks of pixels with pink color appear on the videosink. These macro-blocks are really ugly and not desired.

I have tried few things and observations were as follows:
  1. Modified all the default properties on "vaapivp8enc" element --> still pixelated macro-blocks appear
  2. Do not change aspect-ratio property  --> pixelated macro-blocks do not appear
  3. Replace hardware accelerated vaapi encoding - "vaapivp8enc" element with normal software enabled encoding - "vp8enc" element --> pixelated macro blocks do not appear
Please help me understand if
  1. The way I am setting the "aspect-ratio" property directly is correct and why does it impact the encoder? OR Ideal way to set property in a running pipeline is - pause pipeline, unlink element, create element with right property, link element, play the pipeline again?
  2. Are there any specific combination of property values that can be used with "vaapivp8enc" to solve this issue?

Kindly guide me in right direction..

--
Thanks and Regards,
Saurabh Bora

PH NO : 7038166900
             [hidden email]

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

Re: pixelated macro-blocks on videosink with hardware-acceleration

Saurabh Bora
Hi, 

Could you anyone please help me understand these issues and point in the right direction?


On Tue, Oct 15, 2019, 02:34 Saurabh Bora <[hidden email]> wrote:
Hi Experts, 

I have a gstreamer pipeline to send VP8 encoded data using hardware acceleration:
videotestsrc is-live=yes ! aspectratiocrop aspect-ratio=4/3 ! vaapivp8enc ! rtpvp8pay !application/x-rtp,media=video,encoding-name=VP8,payload=96  ! udpsink host-127.0.0.1 port=5000

On the other hand, following pipeline is used to decode the data and display on a videosink:
udpsrc port=5000 caps = "application/x-rtp, media=video, clock-rate=90000, encoding-name=VP8, payload=96" ! rtpvp8depay ! decodebin ! videoconvert ! autovideosink

When a specific event happens, I change the "aspect-ratio" property on "aspectratiocrop" element to 1/1. I achieve this by using below code:

  GstElement* cropStream = gst_bin_get_by_name(GST_BIN(pipeline), "aspectRatio");
  if (cropStream == NULL)
  {
      return -1;
  }
  //Set aspect-ratio property as 1/1.
  g_object_set(cropStream, "aspect-ratio", 1, 1, NULL);


The property is successfully changed and aspect ratio changes to "1/1". However, for a second or so, macro-blocks of pixels with pink color appear on the videosink. These macro-blocks are really ugly and not desired.

I have tried few things and observations were as follows:
  1. Modified all the default properties on "vaapivp8enc" element --> still pixelated macro-blocks appear
  2. Do not change aspect-ratio property  --> pixelated macro-blocks do not appear
  3. Replace hardware accelerated vaapi encoding - "vaapivp8enc" element with normal software enabled encoding - "vp8enc" element --> pixelated macro blocks do not appear
Please help me understand if
  1. The way I am setting the "aspect-ratio" property directly is correct and why does it impact the encoder? OR Ideal way to set property in a running pipeline is - pause pipeline, unlink element, create element with right property, link element, play the pipeline again?
  2. Are there any specific combination of property values that can be used with "vaapivp8enc" to solve this issue?

Kindly guide me in right direction..

--
Thanks and Regards,
Saurabh Bora

PH NO : 7038166900
             [hidden email]

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel