GNOME Bugzilla – Bug 653013
h264parse fails to create SPS when input uses 4 byte start code
Last modified: 2011-11-28 11:21:43 UTC
When parsing an H.264 byte stream which uses a 4 byte start code (00000001), with an encoder that doesn't output codec_data, h264parse generates an incorrect avc Configuration record. gst_h264_parse_make_codec_data uses hard coded offsets into the saved SPS NAL which only work when using a 3 byte start code. Unfortunately, this was found with a hardware accelerated encoder, so it will be hard for other people to reproduce.
Created attachment 190285 [details] [review] Workaround Using this patch, h264parse works for me
The nals stored in sps_nals and pps_nals are 'normalized' to always have a 4-byte start code (as also indicated by using - 4 in the size calculations). However, wrong offsets are being used to extract the needed bits/bytes, and following commit takes care of that: commit eca1614f08b83e4bc845597f2d501a58c372aca7 Author: Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> Date: Wed Jun 22 10:13:38 2011 +0200 legacyh264parse: create correct avc codec-data Fixes #653013.
*** Bug 664811 has been marked as a duplicate of this bug. ***