PDA

View Full Version : h.264 - how to identify synchronization markers in h.264 bitstream


itzcoolbuddy
25th October 2004, 00:47
Hi,

I am trying to identify synchronization markers in h.264 encoded bit stream. How can I do this? Also kindly tell me if i could find any document that gives the h.264 encoded bit stream format specification.

Please kindly help me.

Thanks
venky

bond
25th October 2004, 19:47
Originally posted by itzcoolbuddy
I am trying to identify synchronization markers in h.264 encoded bit stream. How can I do this?if the stream is stored in .mp4 you could try to run mpeg4ip's mpeg4vol tool on the file, which should read out the vol of the stream, which should tell if resync markers got used (note that i am only guessing here, i dunno how the vols are handled with h.264, but you might want to try it)

if the h.264 stream is not stored in a container, but is a raw stream, you might want to run mpeg4ip's "h264.exe" tool on it, which might display the wanted info too

Also kindly tell me if i could find any document that gives the h.264 encoded bit stream format specification :readfaq:

itzcoolbuddy
26th October 2004, 21:43
hi bond
thanks for ur reply
but that didn't help me a lot :(

here is my exact problem

I want to send the h.264 encoded byte stream (which is stored as test.264 file) from one system to another using a client server program in C, and, simulate a packet loss environment. At the reciever, some random data will be lost.
But, i'm not able to run the decoder due to the lost data. Is there anyway I could make the decoder work ? I have no idea how to use the start code prefix.

your help would be greatly appreciated.
Thank you

venky

bond
26th October 2004, 22:11
no clue, sorry :(

ac-chan123
26th October 2004, 23:07
On bondīs MPEG4 Information (http://forum.doom9.org/showthread.php?s=&threadid=73022) Site, you can find a link to the JVT-500.PDF file. This is a Draft of the H.264/AVC Standard.

KidOnTheWay
5th November 2004, 05:53
Hi buddy,

the start code prefix handling in h.264 is easy and nicely defined. Start code is 24 bits long and should be "000001" in hex. this code is prohibited in the data, by emulation prevention bits.

put all the incoming bit stream in a buffer and look for this code in the stream. when you find this code you can, it indicates the start of a NAL unit from the next bit. This is the case when incoming stream is byte alingned. If stream is not byte aligned, then check bit by bit for continuos 23 zeros and following single bit 1. There is a nice normative method suggested in the standard document itself.

I think this may help

KidOnTheWay

spyder
6th November 2004, 18:29
KidOnTheWay,

AFAIK all mpeg elements start with 0x000001 so you won't necessarily find a NALU start at each one. For example, in MPEG-2 each header starts with 0x000001 and then each frames and each slice etc.. The 0x000001 is simple a startcode, you need to look at the next byte to see what type of bitstream element it is. Also, I'm not to familiar with the MPEG-4 specs but in MPEG2 the startcodes are byte-aligned always. there's no reason to have to check for a bit pattern.

KidOnTheWay
8th November 2004, 05:54
In H.264/AVC everything,either header,slice data or anything else, is inside a NALU, so to start decoding you have to find the start of the NALU. NALU header will tell you then, whether its a header NALU or slice data NALU, or it ontains other video information. So NALU is the unit which one have to look for.


KidOnTheWay

viju
28th April 2009, 20:27
Hi All,

I have riquirement like , I get raw h264 nalu's from the RTP receiver, am producing the Mp4 file from that on the fly using gpac API's, but it is not playable until unless import (complete) is complete.

I read ISOmedia.h from gpac, like frgamented Movie Fragments is a feature of ISO media files for fragmentation
of a presentation meta-data and interleaving with its media data.
This enables faster http fast start for big movies, and also reduces the risk
of data loss in case of a recording crash, because meta data and media data
can be written to disk at regular times

This I tried and but it is not working, mean it is not playable

I executed the command like this below

MP4BOX -frag 500 xxx.mp4

please suggest me that am doing anything wrong and let me know in which player it is playable.

Actually my requirement is that file shoud be playable in adobe flash player.

Suggest me an idea that the produced MP4 file to make streamable on the fly.

please through a light on this......


Thanks & Regards
Viju