Opened 5 years ago

Closed 5 years ago

#3787 closed defect (fixed)

h264 parser only accepts extradata before the first frame

Reported by: benjamin Owned by:
Priority: normal Component: avcodec
Version: unspecified Keywords: h264
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no


Summary of the bug:
The H264 parser only accepts extradata before the first frame. If further extradata occurs, the parser fails to find the frame, since it tries to interpret the begining of the extradata as the nal size. Interestingly, the full ffmpeg H264 decoder accepts properly extradata before every frame. Thus, the problem only happens when using a container that requires the use of the H264 parser. In particular, this bug prevents good transcoding of H.264 videos with extra extradata when the format is FLV.

Attachments (1)

example.flv (895.7 KB) - added by benjamin 5 years ago.
File to reproduce the problem

Download all attachments as: .zip

Change History (4)

comment:1 Changed 5 years ago by cehoyos

  • Keywords h264 added

Unfortunately, this has currently no similarities with a valid ticket.

Is the problem you see reproducible with ffmpeg (the application)? If yes, please provide the failing command line (that does not produce the intended output file) together with the complete, uncut console output and point us to a sample.
If the problem is not reproducible with {{{ffmpeg), please explain how we can reproduce the issue.

Version 0, edited 5 years ago by cehoyos (next)

Changed 5 years ago by benjamin

File to reproduce the problem

comment:2 Changed 5 years ago by benjamin

Consider the file I just attached. Asking ffmpeg to read this file gives:

[flv @ 0x63ff90] Stream discovered after head already parsed
[h264 @ 0x6409e0] AVC: nal size 21839903
[h264 @ 0x6409e0] missing picture in access unit with size 37
Input #0, flv, from '/home/benjamin/Downloads/example.flv':
  Duration: 00:00:09.92, start: 0.000000, bitrate: 739 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p, 720x400, 25 fps, 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac, 44100 Hz, stereo, fltp
    Stream #0:2: Data: none

As I said in the opening comment, the invalid NAL size warning is because the h264 parser is trying to interpret extradata as a NAL unit.

comment:3 Changed 5 years ago by michael

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.