[Live-devel] How to judge a H264 NALU ends an access unit(without access unit delimiter)?

Etienne Bömcke etienne.bomcke at uclouvain.be
Fri Mar 14 10:15:25 PDT 2008


Are you sure about this? Using latest version of x264 I got NALU's  
starting with 0x000001, but the fourth byte hasn't any of the three  
values you mentioned. According to the standard, the fourth byte is  
composed of one reserved bit which value is set to 0 followed by two  
bits for the nal_ref_idc parameter (describing whether the NAL  
contains a SPS, PPS, reference frame or other type of frame),  and the  
five remaining ones are for the nal_unit_type parameter.
Imagine you take the first NAL of the first i-frame of a given  
sequence, the fourth byte should be composed by the following bits :

- 0 (reserved zero_bit)
- 11 (nal_ref_idc set to 3 for IDR frames)
- 00101 (nal_unit_type takes value of 5 for IDR slice data)

which gives 0x65, the value I get in an x264 encoded file. How do you  
explain these three values you gave?

To answer Felix's question, I don't see any easy way to judge when a  
NAL unit ends an AccessUnit. However you can easily check if a NAL  
begins a next AccessUnit :
- if the fourth byte indicates a SPS or PPS
or
- in case the fourth byte indicates a frame (I, P or B), if the two  
bits immediately following it are 01 (meaning the first_mb_in_slice  
has a value of 0)
then you got a new Access Unit.

I'm not familiar with the liveMedia library, so I haven't got a clue  
if you can use this information in your particular context. It should  
be possible to parse the whole NAL byte stream to "count" the  
macroblocks in the NAL and check when the NAL contains the last MB of  
the frame, but I suspect this would be quite resource-consuming...

Cheers,

Etienne

On 14 Mar 2008, at 16:43, Ralf Buhlrich wrote:

> Hi,
>
> each NALU starts with 0x00 0x00 0x01
> The forth byte of a NALU can take one of the following values:
>
> 0x4d
> 0x9a
> 0x9e
>
> Best regards
>
> Ralf
>
> Am Freitag, den 14.03.2008, 23:18 +0800 schrieb 徐巍 :
>> Hi all:
>>
>> I am trying to stream an h264 file(a bytestream file of NALU) with
>> livemedia.
>> In Mojtaba Hosseini's tutorial for H264 RTP streaming, I get to know
>> that the key point is to implement the function:
>> H264VideoStreamFramer::currentNALUnitEndsAccessUnit().
>>
>> Could anybody give me some guides in judging whether a NALU ends one
>> AccessUnit when streaming from a h264 file(a bytestream of NALU)?
>>
>> Thanks!
>>
>> B.R.
>> Felix
>>
>> ______________________________________________________________________
>> 雅虎邮箱传递新年祝福,个性贺卡送亲朋!
>> _______________________________________________
>> live-devel mailing list
>> live-devel at lists.live555.com
>> http://lists.live555.com/mailman/listinfo/live-devel
>
>
>
>
> -- 
>
> Geschäftsführung/Management Board Rheinmetall Defence Electronics  
> GmbH:
> Dipl.-Wirtsch.-Ing. Georg Morawitz
> Dipl.-Ing. Luitjen Ennenga
> Dipl.-Ing.Ulrich Sasse
> Sitz der Gesellschaft/Registered Office: Bremen
> Register/Commercial Register: Amtsgericht Bremen, HRB 9659
>
>
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte  
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese  
> E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den  
> Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren  
> sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
>
> The statements contained in this message are not legally binding  
> unless confirmed in writing.
> This message may contain confidential information. If you are not  
> the intended recipient, or if this message and its annexes contains  
> information which is apparently not meant for you, please notify us  
> immediately and - to the extent you are not the intended recipient -  
> please delete this message and all its attachments from your system  
> and destroy any copy made therefrom.
> Any unauthorized review, delivery, distribution, transmission,  
> storage, printing or otherwise making use of the message and its  
> attachments are strictly prohibited.
> In case your systems have been infected by virus or otherwise  
> negatively affected by this message, we will not be liable for any  
> damage resulting therefrom unless in case of gross negligence or  
> wilful misconduct.
>
>
>
> Geschäftsführung/Management Board Rheinmetall Technical  
> Publications GmbH:
> Dipl.-Ing. Jörg Daniel
> Sitz der Gesellschaft/Registered Office: Bremen
> Register/Commercial Register: Amtsgericht Bremen, HRB 24359 HB
>
> _______________________________________________
> live-devel mailing list
> live-devel at lists.live555.com
> http://lists.live555.com/mailman/listinfo/live-devel

--
Etienne Bömcke
UCL - Laboratoire TELE
etienne.bomcke at uclouvain.be





More information about the live-devel mailing list