Opened 14 years ago

Closed 14 years ago

#23 closed defect (fixed)

Broken h264 with vaapi and vdpau

Reported by: Ivan Ivanich Owned by: Michael Niedermayer
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 Ivan Ivanich 14 years ago.
Video corruption
0001-vaapi-filter-out-DELAYED_PIC_REF-flag-to-determine.patch (845 bytes ) - added by Gwenole Beauchesne 14 years ago.
Filter out DELAYED_PIC_REF flag

Download all attachments as: .zip

Change History (14)

by Ivan Ivanich, 14 years ago

Attachment: vlc_vaapi.jpeg added

Video corruption

comment:1 by Gwenole Beauchesne, 14 years ago

Status: newopen

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

comment:2 by Gwenole Beauchesne, 14 years ago

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 by Gwenole Beauchesne, 14 years ago

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

in reply to:  3 comment:4 by Ivan Ivanich, 14 years ago

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 by Gwenole Beauchesne, 14 years ago

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 by Gwenole Beauchesne, 14 years ago

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.

by Gwenole Beauchesne, 14 years ago

Filter out DELAYED_PIC_REF flag

comment:7 by Gwenole Beauchesne, 14 years ago

Please try the attached patch.

in reply to:  7 comment:8 by Ivan Ivanich, 14 years ago

Replying to gb:

Please try the attached patch.

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

comment:9 by Michael Niedermayer, 14 years ago

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

in reply to:  9 comment:10 by Ivan Ivanich, 14 years ago

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 by Gwenole Beauchesne, 14 years ago

OK, I will apply. Thanks.

comment:12 by Gwenole Beauchesne, 14 years ago

Analyzed by developer: set
Cc: gbeauchesne@splitted-desktop.com added
Reproduced by developer: set
Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.