Opened 5 years ago

Closed 5 years ago

#23 closed defect (fixed)

Broken h264 with vaapi and vdpau

Reported by: ivanich Owned by: michael
Priority: normal Component: ffmpeg
Version: git Keywords:
Cc: gbeauchesne@splitted-desktop.com Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes

Description

Enabling Gpu acceleration in vlc cause hd video corruption. It happens with latest ffmpeg from git compiled with vaapi support, older versions ffmpeg(revision 25767) and current libav from git works just fine.
I'm using vdpau-video-0.7.3 and libva-0.32.0_p2.

Attachments (2)

vlc_vaapi.jpeg (208.6 KB) - added by ivanich 5 years ago.
Video corruption
0001-vaapi-filter-out-DELAYED_PIC_REF-flag-to-determine.patch (845 bytes) - added by gb 5 years ago.
Filter out DELAYED_PIC_REF flag

Download all attachments as: .zip

Change History (14)

Changed 5 years ago by ivanich

Video corruption

comment:1 Changed 5 years ago by gb

  • Status changed from new to open

Hi, reproduced with mplayer + FFmpeg checkout as of today. I will look into it.

comment:2 Changed 5 years ago by gb

A quick look reveals that reference fields in h->short_ref[] are different from those that would be generated by the other/older FFmpeg version.

comment:3 follow-up: Changed 5 years ago by gb

Does this fails on Windows too? i.e. with DXVA2 enabled?

comment:4 in reply to: ↑ 3 Changed 5 years ago by ivanich

Replying to gb:

Does this fails on Windows too? i.e. with DXVA2 enabled?

Unfortunately, I can not check, I do not have Windows.

comment:5 Changed 5 years ago by gb

The bug might be introduced by MT branch merge, since a checkout of 4c886d613df8b217c6d62cb2c94e88f848177b23 (just prior the merge) makes it work. i.e. pic->reference flags are correctly generated.

comment:6 Changed 5 years ago by gb

The new code generates extra DELAYED_PIC_REF, thus making code like if (pic->reference != PICT_FRAME) to check for something that is not a frame (i.e. top or bottom field) to fail. I have a patch at the VA-API level as I am not able to check why h264.c changes operate that way now.

i.e. even in non-VAAPI case, h264 code that uses the FIELD_PICTURE macro may not get what it expected in the older code.

Changed 5 years ago by gb

Filter out DELAYED_PIC_REF flag

comment:7 follow-up: Changed 5 years ago by gb

Please try the attached patch.

comment:8 in reply to: ↑ 7 Changed 5 years ago by ivanich

Replying to gb:

Please try the attached patch.

Patch did the trick, now everything works as before. Thanks.

comment:9 follow-up: Changed 5 years ago by michael

The patch looks quite harmless, if that fixes it, i have no objections

comment:10 in reply to: ↑ 9 Changed 5 years ago by ivanich

Replying to michael:

The patch looks quite harmless, if that fixes it, i have no objections

It would be nice if you could put it in upstream.

comment:11 Changed 5 years ago by gb

OK, I will apply. Thanks.

comment:12 Changed 5 years ago by gb

  • Analyzed by developer set
  • Cc gbeauchesne@splitted-desktop.com added
  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.