Skip to content

raw NV12 video output offset problem. #54

Description

@ugurlu

There seems to be a problem with offset of the raw NV12 output. Following gstreamer script works with nvidia vdpau driver. However with sunxi driver there seems to a shift of 8 bytes. Following dirty patch fixed problem for me. Now the output of raw video is same as the output of software decoder and nvidia vdpau decoder. Video is big_buck_bunny_720p_1mb.mp4. Board is BananaPI with A20 cpu.

On the other hand with or without patch there's no issue with autovideosink. Video plays fine.

Can anyone recommend a better approach?

$ gst-launch-1.0 filesrc location=b1.mp4  ! qtdemux ! queue ! vaapih264dec ! queue !  filesink location=/tmp/hw-full.raw
@@ -207,12 +211,17 @@ VdpStatus vdp_video_surface_get_bits_y_cb_cr(VdpVideoSurface surface,
 #ifndef __aarch64__
        else if (vs->source_format == INTERNAL_YCBCR_FORMAT && destination_ycbcr_format == VDP_YCBCR_FORMAT_NV12)
        {
-               tiled_to_planar(cedrus_mem_get_pointer(vs->yuv->data), destination_data[0], destination_pitches[0], vs->width, vs->height);
-               tiled_to_planar(cedrus_mem_get_pointer(vs->yuv->data) + vs->luma_size, destination_data[1], destination_pitches[1], vs->width, vs->height / 2);
+               tiled_to_planar(cedrus_mem_get_pointer(vs->yuv->data), destination_data[0]-8 , destination_pitches[0], vs->width, vs->height);
+               tiled_to_planar(cedrus_mem_get_pointer(vs->yuv->data) + vs->luma_size, destination_data[1]-8, destination_pitches[1], vs->width, vs->height / 2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions