h.264 nal unit >> Technical questions >> Our Forum Techna

techna.site

Our Forum Techna



SearchSearch   Users   Registration   Entrance
Today: 31.07.2025 - 22:43:45
Pages:  1  

h.264 nal unit

Advertising


AuthorMessage

aaron

users




Statistics:
Messages: 227
Registration: 02.27.2001

Hi, I would like to identify h.264 files from a list of random file types. The start code prefix of h.264 NAL unit is 0x000001. However 0x000001 also occurs in other file types eg. jpeg. Hence, i am not able to just search for 0x000001 to confirm that it is a h.264 file. Is there any other pattern unique to h.264 file type? i would also like to ask how do i determine h.264 NAL unit length field? Say NAL unit starts when we see the start code prefix 0x000001. How much more bytes after 0x000001 will be the end of a NAL unit? Thank you very much. I have done lots of researching in these 2 areas but am still stuck. Kindly help me.

---------------------
-- Aaron 97 328is
Message # 1 09.02.25 - 14:49:55
RE: h.264 nal unit

GM3

users




Statistics:
Messages: 311
Registration: 04.17.2001

There isn't any unique pattern in h.264 streams. The NAL unit end is marked by the start code prefix of next NAL unit (or EOF); the start code prefix is forbidden within NAL unit.

---------------------
Message # 2 09.02.25 - 14:55:41
RE: h.264 nal unit

83iS

users




Statistics:
Messages: 348
Registration: 02.25.2003

Thank you imcold. Am i right to say that there is no way to find the NAL unit length field (eg. length of NAL unit is 4 bytes)? We can only know the NAL unit length upon spotting the next 0x000001?

---------------------
Message # 3 09.02.25 - 15:07:02
RE: h.264 nal unit

jvit27

users




Statistics:
Messages: 6,599
Registration: 03.02.2001

Not sure I understand you, but NAL doesn't have length field. If the bytestream is wrapped in some container, then the container may contain some information about NALs, possibly even their length. Answer to second question is yes, you'll just have to search through the stream. You may take a look at , it has code for h.264 stream parsing.

---------------------
'99 Estoril Blue + Dove Grey ///M3 coupe '04 Jet Black + Cinnamon ///M3 coupe
Message # 4 09.02.25 - 15:16:51
RE: h.264 nal unit

mikeinsanmarcos

users




Statistics:
Messages: 93
Registration: 10.04.2001

As I understand, what you really need is probing each file by pre-fetching numbers of data (not only according to the file extension): 1. Identify which file format a file is using according to corresponding spec of container (e.g. TS, MP4, AVI); 2. Retrieved desired info (e.g. a/v codec) either from meta data of container (e.g. moov box/atom in MP4, CodecID of VideoTagHeader in FLV) or parsing using some pattern as you mentioned. Enjoy!

---------------------
ford truck
Message # 5 09.02.25 - 15:22:39
RE: h.264 nal unit

jaeo

users




Statistics:
Messages: 213
Registration: 12.13.2003

btw. couldn't one simply use mediainfo for the whole thing?

---------------------
Message # 6 09.02.25 - 15:26:09
RE: h.264 nal unit

LittleBlueBMW

users




Statistics:
Messages: 2,558
Registration: 12.11.2003

I mainly ment MediaInfo as a response to "I would like to identify h.264 files from a list of random file types." and thought about calling: Code:

---------------------
"If you go backwards through the Pearly Gates in a giant fireball, that's a cool way to die." -Richard Hammond
Message # 7 09.02.25 - 15:36:52
RE: h.264 nal unit
Bypass all inserts? : Previous topicNext topic: would this stop it from playing on standalone?
Pages:  1  

The administrator has prohibited guests from replying to messages! To register, follow the link: register


Participants