Opened 5 weeks ago

Last modified 4 weeks ago

#6668 new defect

MPEG2 decoding failed with FFMPEG-VAAPI

Reported by: lizhong1008 Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: vaapi_mpeg.c, mpeg2
Cc: jun.zhao@intel.com Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
The decoded frames of some mpeg2 files are wrong when decoding with vaapi hwaccel. Seems it only happens when decoding interlaced files, and ffmpeg software decoder (without vaapi hwaccel) is also ok except with a dummy frame as the first frame.

How to reproduce:
./ffmpeg -vaapi_device /dev/dri/renderD128 -hwaccel vaapi -i /root/Videos/yami_mpeg2/tcela-8-fp-dp.bits.mpeg2 -pix_fmt yuv420p tcela-8-fp-dp.bits.mpeg3_720x480.yuv
ffmpeg version N-86991-g62697878a9 Copyright (c) 2000-2017 the FFmpeg developers

built with gcc 6.3.0 (Ubuntu 6.3.0-12ubuntu2) 20170406
configuration: --prefix=/opt/X11R7/ --enable-vaapi --enable-libx264 --enable-libx265 --enable-gpl --disable-optimizations --enable-debug=3
libavutil 55. 74.100 / 55. 74.100
libavcodec 57.102.100 / 57.102.100
libavformat 57. 76.100 / 57. 76.100
libavdevice 57. 7.100 / 57. 7.100
libavfilter 6. 99.100 / 6. 99.100
libswscale 4. 7.102 / 4. 7.102
libswresample 2. 8.100 / 2. 8.100
libpostproc 54. 6.100 / 54. 6.100

libva info: Open new log file ./libav.064907.thd-0x00007cb2 for the thread 0x00007cb2
libva info: LIBVA_TRACE is on, save log into ./libav.064907.thd-0x00007cb2
libva info: LIBVA_TRACE_BUFDATA is on, dump buffer into log file
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/X11R7/lib/dri/i965_drv_video.so
libva info: Found init function vaDriverInit_0_40
libva info: va_openDriver() returns 0
[mpegvideo @ 0x56148afa5140] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegvideo, from '/root/Videos/yami_mpeg2/tcela-8-fp-dp.bits.mpeg2':

Duration: 00:00:00.15, bitrate: 15000 kb/s

Stream #0:0: Video: mpeg2video (Main), yuv420p(tv, bottom first), 720x480 [SAR 8:9 DAR 4:3], 15000 kb/s, 30 fps, 30 tbr, 1200k tbn, 60 tbc

File 'tcela-8-fp-dp.bits.mpeg3_720x480.yuv' already exists. Overwrite ? [y/N] y
Stream mapping:

Stream #0:0 -> #0:0 (mpeg2video (native) -> rawvideo (native))

Press [q] to stop, ? for help
libva info: Save context 0x02000000 into log file ./libav.064907.thd-0x00007cb2
Output #0, rawvideo, to 'tcela-8-fp-dp.bits.mpeg3_720x480.yuv':

Metadata:

encoder : Lavf57.76.100
Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x480 [SAR 8:9 DAR 4:3], q=2-31, 124416 kb/s, 30 fps, 30 tbn, 30 tbc
Metadata:

encoder : Lavc57.102.100 rawvideo

frame= 5 fps=0.0 q=-0.0 Lsize= 2531kB time=00:00:00.16 bitrate=124415.8kbits/s speed=4.77x
video:2531kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

For HW and driver information, please refer vainfo:
vainfo
libva info: Open new log file ./libav.065514.thd-0x00007cd9 for the thread 0x00007cd9
libva info: LIBVA_TRACE is on, save log into ./libav.065514.thd-0x00007cd9
libva info: LIBVA_TRACE_BUFDATA is on, dump buffer into log file
libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /opt/X11R7/lib/dri/i965_drv_video.so
libva info: Found init function vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva 1.8.4.pre1)
vainfo: Driver version: Intel i965 driver for Intel(R) Kabylake - 1.8.4.pre1 (1.8.3-119-g3ad9717)
vainfo: Supported profile and entrypoints

VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileVP8Version0_3 : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointEncSlice
VAProfileVP9Profile2 : VAEntrypointVLD

Attachments (2)

tcela-8-fp-dp.bits.mpeg2 (281.1 KB) - added by lizhong1008 5 weeks ago.
sony-ct1.bits.mpeg2 (674.7 KB) - added by lizhong1008 5 weeks ago.

Download all attachments as: .zip

Change History (3)

Changed 5 weeks ago by lizhong1008

Changed 5 weeks ago by lizhong1008

comment:1 Changed 4 weeks ago by lizhong1008

Patch (https://patchwork.ffmpeg.org/patch/5209/) has been sent to fix this issue.

Note: See TracTickets for help on using tickets.