[VDPAU] ffmpeg and HEVC: Partial success, need help understanding problem

Jose Soltren jsoltren at nvidia.com
Tue May 26 07:19:40 PDT 2015


Inline below.

On 2015/05/23, 22:49 , "Philip Langdale" <philipl at overt.org> wrote:

>On Sat, 23 May 2015 12:52:08 -0700
>Philip Langdale <philipl at overt.org> wrote:
>
>> Ok, that's not right. I'd forgotten what the original sample looked
>> like. What I think it really looks like is that it's rendering twice
>> as tall as it should, alternating black lines with the actual picture
>> lines, and then that's wrapping around.
>
>Really, what it ends up looking like is what you'd see if someone took
>a progressive frame, and then said it was really an interlaced frame
>with the top half as one field and the bottom half as another. I can
>provide samples if it helps.

Yep, that's exactly what is happening. Unfortunately, the answer is: you
need to lie to VDPAU about what is happening here. Use
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD as the
current_picture_structure parameter to VdpVideoMixerRender().

The root of the problem is that the VdpVideoMixer does not know anything
at all about the format of the content you are feeding to it. It does not
know the codec or the process that generated the picture. It is
purposefully undefined.

Perhaps a long term solution here would be to add a new
VDP_VIDEO_MIXER_PICTURE_STRUCTURE_ enumeration value for this specific
case.

I discovered this issue when writing an internal VDPAU demo. This is the
comment that I wrote at the time:

/*

  XXX HACK XXX

  NVIDIA VDPAU assumes that PICTURE_STRUCTURE_FRAME has a top field
  and a bottom field that need to be merged into one. We only set
  PICTURE_STRUCTURE_TOP_FIELD to prevent NVIDIA VDPAU from merging
  fields which results in incorrect output. PICTURE_STRUCTURE_BOTTOM_FIELD
  would work equally well here.

  Part of the issue is that the VdpVideoMixer has no concept of which video
  codec is in use. NVIDIA VDPAU HEVC decoding does not have any concept of
  top and bottom field since the HEVC specification itself does not. All
  video decoding results in progressive frames according to the
specification.

  An alternate to this hack is ignoring current_picture_structure entirely
  within the VDPAU implementation for HEVC decoding. This is easier for
now.

  For VDPAU HEVC decoding, video_surface_past and video_surface_future
should
  be NULL for progressive frames. Presentation of interlaced frames will
work
  as for formats with native interlaced decoding but note that each field
will
  be an HEVC frame in its own right.

  */


Sorry this is so ugly. I hope this helps.

Thanks,
--José

nvpublic

>--phil



More information about the VDPAU mailing list