After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 653013 - h264parse fails to create SPS when input uses 4 byte start code
h264parse fails to create SPS when input uses 4 byte start code
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.22
Other Linux
: Normal major
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 664811 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-06-20 14:41 UTC by phil.edworthy
Modified: 2011-11-28 11:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Workaround (1.13 KB, patch)
2011-06-20 16:11 UTC, phil.edworthy
rejected Details | Review

Description phil.edworthy 2011-06-20 14:41:31 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.
Comment 1 phil.edworthy 2011-06-20 16:11:44 UTC
Created attachment 190285 [details] [review]
Workaround

Using this patch, h264parse works for me
Comment 2 Mark Nauwelaerts 2011-06-22 08:26:16 UTC
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.
Comment 3 Mark Nauwelaerts 2011-11-28 11:21:43 UTC
*** Bug 664811 has been marked as a duplicate of this bug. ***