Opened 10 years ago

Closed 10 years ago

#3787 closed defect (fixed)

h264 parser only accepts extradata before the first frame

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

Description

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 Peterson 10 years ago.
File to reproduce the problem

Download all attachments as: .zip

Change History (4)

comment:1 by Carl Eugen Hoyos, 10 years ago

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.

Last edited 10 years ago by Carl Eugen Hoyos (previous) (diff)

by Benjamin Peterson, 10 years ago

Attachment: example.flv added

File to reproduce the problem

comment:2 by Benjamin Peterson, 10 years ago

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 by Michael Niedermayer, 10 years ago

Reproduced by developer: set
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.