After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 762547 - The NV12 UV plane address does not match with 1920x1080 frames
The NV12 UV plane address does not match with 1920x1080 frames
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer-vaapi
1.6.3
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-02-23 16:22 UTC by Thomas Scheuermann
Modified: 2016-11-23 16:44 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Scheuermann 2016-02-23 16:22:13 UTC
I use a pipeline like

vaapidecode ! vaapipostproc ! appsink

The buffer I get from appsink with

buffer = gst_sample_get_buffer(_sample);
caps = gst_sample_get_caps(_sample);
gst_video_frame_map(&frame, &vinfo, buffer, GST_MAP_READ);

has a mismatch of the UV plane with the NV12 format.

I should be able to access the video planes via
frame.data[0] for the Y plane and
frame.data[1] for the UV plane.

But the UV plane does not start there, it starts later.
With lower resolutions like 1280x720 this doesn't happen. There the address is correct.
Comment 1 cJ-gnome 2016-09-10 18:12:47 UTC
Hi,

vaapidecode is outputting buffers with 1088 rows, when asked to decode 1920x1080.
The problem is, the pipeline doesn't know about that.

Regards,
Comment 2 Víctor Manuel Jáquez Leal 2016-09-15 10:02:32 UTC
Could you try with gstreamer-vaapi 1.9.2 ??

We have a lot of changes regarding resolution handling for non-accelerated sinks.

Or could you upload a test code with appsink?
Comment 3 Thomas Scheuermann 2016-09-15 11:09:33 UTC
I will do so as soon as I get the time for it.
Thanks
Comment 4 Thomas Scheuermann 2016-11-16 10:21:43 UTC
I have tested it with 1.10.0
I can see that the plane address is correct.
But the strides and the offsets are still wrong.
Comment 5 Víctor Manuel Jáquez Leal 2016-11-16 10:44:15 UTC
Do you have test app to share?
Comment 6 Víctor Manuel Jáquez Leal 2016-11-23 16:44:07 UTC
Aha!

Now I can imagine what's happening!

appsink doesn't negotiates a buffer pool with GST_BUFFER_POOL_OPTION_VIDEO_META and, only if downstream requests it, the vaapi buffer pool will stamp the GstVideoMeta in the buffer with the correct strides and offsets. Without it, the gst_video_frame_map() will try to figure out those parameters which may not match with the GPU mapped memory.

So, either you create your own sink which ask for a buffer pool with GST_BUFFER_POOL_OPTION_VIDEO_META, or, perhaps, you should insert a software-based video filter, like gamma, to request it for you.

I'm going to close the issue but if you feel that we should fix something in gstreamer-vaapi, please reopen it.