Log in

View Full Version : H.264 header information


Mobileace
21st December 2009, 07:28
Hi experts,

Am i able to find out how many bytes in the H.264 stream is used for header information? For eg. 1st 20 bytes for header...etc.

Reason for this is i intend to inject some random noise into the H264 stream but i realised it cant play totally. Was wondering if there is error in the header information that caused the video not to even play.

MatLz
21st December 2009, 13:56
Hi expertsI'm not, sorry!:Dhow many bytes in the H.264 stream is used for header information?I think ~500-700bytesi intend to inject some random noise into the H264 stream:confused: I think it's not possible...

lnatan25
21st December 2009, 14:02
What do you mean impossible? He probably wants to simulate signal noise, which is very possible and also probable for testing.

LoRd_MuldeR
21st December 2009, 14:05
Well, he could flip some random bits in the stream and then check if it is still decodable and how strong the resulting distortions are (e.g. for testing a decoder's error robustness).

Of course that won't add random "salt and pepper" noise to the decoded picture, but that's probably not what he wants anyway.

Also: If you want to skip the "headers", then you must use a H.264 bistream parser, I think. Headers may even repeat periodically. I'd say: have a look at Annex B of the H.264 standard ;)

http://neuron2.net/library/avc/T-REC-H%5B1%5D.264-200711-I!!PDF-E.pdf

lnatan25
21st December 2009, 14:09
Well, for true testing, wouldn't noise in the header also be probable, thus should be tested as well?

LoRd_MuldeR
21st December 2009, 14:11
Well, for true testing, wouldn't noise in the header also be probable, thus should be tested as well?

I think so. But with a "broken" header right at the beginning, you may have to wait for first "correctly" received header before you can decode anything...

aldenml
21st December 2009, 17:24
Use this tool to get an idea of how looks the MP4 moov box (the header) http://mp4explorer.codeplex.com/. You will see that it is possible to have some errors in the sample tables and still you are able to play the video, but if you can't read the codec info boxes, hmmm... I don't think so.

Mobileace
22nd December 2009, 02:01
Thanks all guys(expert) for your help.

Ya, i want to skip the header and i know error is prone on the header as well. But for this test i just want to assume that the header is error free.

Hence i want to take away all the header, feed noise into the rest of the stream and add back the header to see if the video is still decodable or not.

So any1 knows exactly i should do? Any directions for me? Time is getting short for me.. sad!:thanks:

LoRd_MuldeR
22nd December 2009, 02:06
As said before, the H.264 bitstream format is defined in Annex B of the standard (see link in my post above).

Mobileace
22nd December 2009, 02:21
May i know where i can download the H264 parser to try out?

LoRd_MuldeR
22nd December 2009, 02:28
Well, "the" H.264 parser doesn't exist. You can either implement a parser yourself (based on the H.264 standard) or you adapt some existing H.264 parser source code for your purpose.

The H.264/AVC JM Reference Software can be found here:
http://iphome.hhi.de/suehring/tml/

Guest
22nd December 2009, 02:29
You can adapt a usable parser from my tool DGAVCPulldown, for which the source code is available.

In the parse_nalu() function there is a switch that receives every NALU. You can selectively add errors to the slice NALUs, avoiding the SPS/PPS NALUs ("headers").