Opened 22 months ago

Last modified 22 months ago

#5514 open defect

Interlaced HEVC Steam not Decoded Properly

Reported by: jlsantiago0 Owned by:
Priority: normal Component: avcodec
Version: git-master Keywords: hevc
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug:

I have a 480i interlaced HEVC elementary stream. The HM reference decoder decodes the stream and generates 720x480 interlaced frames. FFMPEG/FFPLAY decodes the stream and 720x240 progressive frames and FFPLAY plays them at half the frame rate with the first/second field/frames bouncing up and down a line because these are actually 2 different fields of the same frame.

How to reproduce:

ffmpeg -i src13_interlaced.265 src13_interaced.yuv
ffplay src13_interlaced.265

$ ffmpeg -i src13_interlaced.265 src13_interaced.yuv
ffmpeg version git-2016-04-27-7bccbee-VF Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
  configuration: --extra-version=VF --prefix=/mnt/kermit/work/git/ort/build/linux64/stage/ffmpeg --ld=/usr/bin/cc --target-os=linux --arch=x86_64 --cpu=x86_64 --enable-pic --enable-static --enable-shared --enable-rpath --enable-avfilter --enable-pthreads --enable-zlib --enable-bzlib --enable-runtime-cpudetect --enable-hardcoded-tables --disable-stripping --disable-doc --disable-dxva2 --disable-vaapi --disable-vda --disable-vdpau --yasmexe=/mnt/kermit/work/git/ort/build/linux64/tools/yasm/bin/yasm --sdl-config=/mnt/kermit/work/git/ort/build/linux64/stage/sdl/lib/../bin/sdl-config --extra-cflags='-I/mnt/kermit/work/git/ort/build/linux64/stage/zlib/include -I/mnt/kermit/work/git/ort/build/linux64/stage/bzip2/include -I/mnt/kermit/work/git/ort/build/linux64/stage/lzma/include -I/mnt/kermit/work/git/ort/build/linux64/stage/sdl/include -DVFBUILD_DISABLE_INTMATH_OPTIMIZATIONS=1' --extra-ldflags='-L/mnt/kermit/work/git/ort/build/linux64/stage/zlib/lib -L/mnt/kermit/work/git/ort/build/linux64/stage/bzip2/lib -L/mnt/kermit/work/git/ort/build/linux64/stage/lzma/lib -L/mnt/kermit/work/git/ort/build/linux64/stage/sdl/lib'
  libavutil      55. 19.100 / 55. 19.100
  libavcodec     57. 28.203 / 57. 28.203
  libavformat    57. 29.200 / 57. 29.200
  libavdevice    57.  0.101 / 57.  0.101
  libavfilter     6. 39.202 /  6. 39.202
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
VFAVUtil_MetaData_RunUnitTests() Completed Successfully.
Input #0, hevc, from 'src13_interlaced.265':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: hevc (Main), yuv420p(tv), 720x240, 30 fps, 30 tbr, 1200k tbn, 30 tbc
Output #0, rawvideo, to 'src13_interaced.yuv':
    encoder         : Lavf57.29.200
    Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p, 720x240, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
      encoder         : Lavc57.28.203 rawvideo
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> rawvideo (native))
Press [q] to stop, [?] for help
frame=  336 fps=0.0 q=-0.0 size=   85050kB time=00:00:11.20 bitrate=62208.0kbitsframe=  337 fps=263 q=-0.0 size=   85303kB time=00:00:11.23 bitrate=62208.0kbitsframe=  522 fps=337 q=-0.0 Lsize=  132131kB time=00:00:17.40 bitrate=62208.0kbits/s speed=11.2x    
video:132131kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%

Attachments (2)

hm_reference_decoder_test.txt (43.6 KB) - added by jlsantiago0 22 months ago.
HM Reference Decoder Test Run
src13_interlaced_cut.265 (2.4 MB) - added by cehoyos 22 months ago.

Change History (7)

comment:1 Changed 22 months ago by jamrial

Can you attach or upload the sample somewhere? Not much we can do otherwise

comment:2 Changed 22 months ago by jlsantiago0

The files are too large to upload to the ticket. 2.5MB limit. I have provided the following files for external download:

HEVC Elementary Stream:

Does not Play correctly with:
   ffplay src13_interlaced.265

FFMPEG Decoder Output:

Does not Play correctly with:
   ffplay -f rawvideo -pix_fmt yuv420p -framerate 30 -s 720x480 -i src13_ffmpeg.yuv
Better but half framerate and field bounce and incorrect resolution with:
   ffplay -f rawvideo -pix_fmt yuv420p -framerate 30 -s 720x240 -i src13_ffmpeg.yuv

HM Reference Decoder Output:

Plays correctly with:
   ffplay -f rawvideo -pix_fmt yuv420p -framerate 30 -s 720x480 -i src13_hm.yuv
Last edited 22 months ago by jlsantiago0 (previous) (diff)

Changed 22 months ago by jlsantiago0

HM Reference Decoder Test Run

comment:3 Changed 22 months ago by heleppkes

Duplicate of ticket #4141

comment:4 Changed 22 months ago by dhelsley

There are differences. In #4141, according to the comments the stream in question has field_seq_flag=1 but pic_struct=3, which is improper syntax, and the reference decoder does the same thing as FFMPEG (output half-height frames).

With this particular elementary stream, field_seq_flag=1 and pic_struct=1 or 2 depending on which field it is, which is valid interlaced syntax. The reference decoder produces proper interlaced output frames with this test vector.

Last edited 22 months ago by dhelsley (previous) (diff)

comment:5 Changed 22 months ago by cehoyos

  • Keywords hevc added
  • Reproduced by developer set
  • Status changed from new to open

Changed 22 months ago by cehoyos

Note: See TracTickets for help on using tickets.