> Do you recommend a method for identifying frame start and end across multiple 
> nals?

Does your encoder not tell you this 'out of band' somehow?

If not, then you can use the following algorithm to tell you if whether or not 
a NAL unit begins a new 'access unit' (i.e., 'frame') - i.e., whether you need 
to call "gettimeofday()" to set the presentation time for this (and perhaps 
subsequent) NAL units:

        Boolean doesH264NALUnitBeginNewAccessUnit(u_int8_t* nalUnit) {
                u_int8_t nal_unit_type = nalUnit[0]&0x1F;

                if ((nal_unit_type >= 6 && nal_unit_type <= 9) || 
(nal_unit_type >= 14 && nal_unit_type <= 18)) return True;

                if (nal_unit_type <= 5 && nal_unit_type > 0) { // we're a VLC 
NAL
                        // Look at the high bit of the next byte; if it's set, 
then this NAL starts a new 'access unit':
                        if ((nalUnit[1]&0x80) != 0) return True;
                }

                return False;
        }


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/

_______________________________________________
live-devel mailing list
live-devel@lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel

Reply via email to