Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#10894 closed defect (invalid)

FFmpeg can't handle h264 NAL units that are split between packets

Reported by: Rokolell Owned by:
Priority: normal Component: undetermined
Version: 6.1 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When a NAL unit is split between AVPackets, FFmpeg fails to decode it properly, causing graphical glitching.

How to reproduce:

  • Download the provided archive with example data.
  • Compile test.c with
    gcc -lavcodec -lavutil -g test.c -o test
    
  • Run the test with
    ./test .
    
  • View 420-440.yuv420p in your preferred raw image viewer to see the glitches. The resolution for each frame is shown by the example program.

Example:
https://cdn.discordapp.com/attachments/1196894597515849779/1212588460393766993/w0j6RKS8ejPgAAAABJRU5ErkJggg.png

Example result created by the Windows Media Foundation Decoder (which can handle these packets perfectly fine):
https://cdn.discordapp.com/attachments/474680786373836801/1214646770525544480/windows-11.png

Change History (5)

comment:1 by Rokolell, 10 months ago

I preemptively uploaded the example to the videolan fileshare.

comment:2 by Rokolell, 10 months ago

Version: unspecifiedgit-master

comment:3 by Rokolell, 10 months ago

Version: git-master6.1

comment:4 by mkver, 10 months ago

Resolution: invalid
Status: newclosed

Our decoders work on proper packets (for the H.264 decoder this means "access units", but generally proper NALUs (that don't span multiple packets) if the AV_CODEC_FLAG2_CHUNKS is set). If you don't have proper packets, use the parsing API to assemble them.

comment:5 by Balling, 10 months ago

So why does MFF has no problem

Note: See TracTickets for help on using tickets.