Digital Video Forums  

Go Back   Digital Video Forums > Video File Formats > Other File Formats

Reply
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 5 votes, 4.60 average. Display Modes
Old 8 Apr 2010, 02:36 AM   #1
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Smile-2 How to read a h264 encoded file.

Hi all,

I have downloaded a h264/avc file from elecard.com/download/clips.php. I am trying to stream this file using live555 libraries. I am struck on how to read the avc file and packetize it.

1. How to verify the NAL unit conetnts in the h264/avc file i.e does the NAL unit have one entire frame in it or the data is distributed in multiple NAL units.
2. To stream, I am planning to packetize one nal unit per RTP packet, (because it is the simplest way to packetize). How to extract each NAL unit from a H264 encoded file?

This question may sound naive, but I would really appreciate any guidance on how to go about this.

Thanks
Amulya
amulya is offline   Reply With Quote
Old 8 Apr 2010, 11:03 AM   #2
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Default got it...identifying nal unts

found this after doing a little reading here and there..

"Basically, NAL units are separated by a simple (at least) 4-byte sequence containing a
big-endian 1, i.e. 00 00 00 01. Finding a NAL unit boundary is therefore as simple as searching for this byte sequence. The NAL unit separators themselves are discarded, only the following NAL unit content is processed further."
amulya is offline   Reply With Quote
Old 11 Apr 2010, 04:31 PM   #3
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Default

I have been working on studying the h.264 bit stream format. As far as I understand, we can identify the nal units containing sequence parameter sets by looking at the nal header octet after start_code_prefix(0x000001). I think the value should be x67 for a sequence parameter set. The 3 bytes after that give us profile_level_idc. However I dont see such pattern anywhere in a sample h.264 file. Please do correct me if I am going wrong somewhere.

Last edited by amulya; 11 Apr 2010 at 04:40 PM
amulya is offline   Reply With Quote
Old 11 Apr 2010, 04:40 PM   #4
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Default

Also, regarding identifying the end of access unit is by looking for a access unit delimiter nal unit which has nal header octet value of x69.
amulya is offline   Reply With Quote
Old 15 Apr 2010, 12:31 AM   #5
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Default

Hi all,

I am using a tool hexedit to view the 264 stream and trying to make some sense out of it according to the 264 spec. I am looking for nal_unit_type 67 and 68 to determine the sprop_paramter_set. I have some concerns
1. The SPS and PPS are not separated by 000001. Currenlty I am thinking the SPS ends until I encounter a 68 which indicates start of PPS. I know my understanding is wrong, but I am lost how else to read the stream.
2. How do I know the length of SPS? There are variable length parameters in the stream.
3. Are the sprop_paramter_set just a base 64 endoded version of these two, seprated by comma?
Here is the portion of the stream with the parametrs
00 17 67 4D 40 33 9A 73 80 A0 08 B4 20 00 32 E9 E0 09 89 68 11 E3 06 23 C0 01 00 04 68 EE 3C 80 00 00 00 14 62 74 72 74 00 04 4A 3E...
How do I know where the SPS ends when there are no NAL separators? Can anybody explan what this stream means?
Please help .

Last edited by amulya; 15 Apr 2010 at 12:35 AM
amulya is offline   Reply With Quote
Old 21 Apr 2010, 01:31 AM   #6
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 1
Default

Some inputs which may help you
The 4-byte sequence 0x 00 00 00 01 is the AnnexB header. It may or may not be present in the bit-stream. It is optional.
SPS starts with 67. PPS starts with 68. And the length of SPS is variable and dependent on the toolsets enabled. The length of SPS can be known by the no of bytes between 67 and 68. in the sample bit-stream shared , SPS size is 17 bytes.
I think using the elecard stream analyser would help you a lot
Akshay is offline   Reply With Quote
Old 7 Jul 2010, 10:26 PM   #7
Junior Member
Junior Member
 
Join Date: Jul 2010
Posts: 1
Default How the separation between slice and MB??

Hi,
I am currently working on H.264 ip.

00000001 byte is a separator between SPS and PPS and SLice header.. Which is demarcation line(separator) between the SLice data and MB header???


Regards,
Kiruba
kiruba is offline   Reply With Quote
Old 10 Sep 2010, 12:36 PM   #8
Junior Member
Junior Member
 
Join Date: Apr 2010
Posts: 6
Default

The 264 spec says
Nal unit synatx follows the following structure
"byte_stream_nal_unit( NumBytesInNALunit ) { C Descriptor
while( next_bits( 24 ) != 0x000001 &&
next_bits( 32 ) != 0x00000001 )
leading_zero_8bits /* equal to 0x00 */ f(8)
if( next_bits( 24 ) != 0x000001 )
zero_byte /* equal to 0x00 */ f(8)
start_code_prefix_one_3bytes /* equal to 0x000001 */ f(24)
nal_unit( NumBytesInNALunit )
while( more_data_in_byte_stream( ) &&
next_bits( 24 ) != 0x000001 &&
next_bits( 32 ) != 0x00000001 )

trailing_zero_8bits /* equal to 0x00 */ f(8)
}"

How do we know the NumBytesInNALunit? Also, how to identify the nal unit start in a packet oriented H264 encoded file. I read from the Annex B that in byte stream oriented files, the delimiter is used, but what about the packet oriented formats? I seem to have hit a road block here :'(
amulya is offline   Reply With Quote
Old 4 Dec 2010, 06:07 PM   #9
Junior Member
Junior Member
 
Join Date: Nov 2010
Posts: 10
Default

Thanks
Friend;
discuss of this type of commitment......
According to this article.
nice article.......
ichandu is offline   Reply With Quote
Old 1 Oct 2011, 03:43 AM   #10
mbr
Junior Member
Junior Member
 
Join Date: Jun 2011
Posts: 1
Default Headers in H.264

Hi
I am working on H.264 FMO 2, ROI coding

I would like to know the header size for SPS and PPS in H.264,
and the cost of PPS in FMO type2 and FMO type6


Thankyou
Ram
mbr is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Muxing an H264 and an AC3 into an MP4 file psychosunshine MP4, MKV, MPEG-4 AVC (H.264) 2 10 Jan 2009 12:34 PM
Good MPEG4 H264 HP to MPEG-4 VISUAL H264 Converter??? Cake^^ MP4, MKV, MPEG-4 AVC (H.264) 1 15 Sep 2008 10:39 AM
Converting H264 file to VCD or DVD compliant MPEG file rock_king_my MP4, MKV, MPEG-4 AVC (H.264) 2 25 Aug 2006 07:09 AM
encoded to a 30GB file!!! james222 AVI, DivX/Xvid 19 27 Jul 2002 05:01 PM
Ulead DVD Plug-in unable to read MPEG encoded by TMPGEnc MSD Conversion/Encoding 0 5 Jun 2002 10:48 PM



All times are GMT +10. The time now is 07:21 PM.

Kirsch designed by Andrew & Austin


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 1999 - 2018 Digital Digest

Visit DivXLand   Visit dvdloc8.com