Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parsing NAL units using FFMPEG

Tags:

ffmpeg

h.264

I am new to MPEG-4 and taking baby steps to learn it. I am using FFMPEG as reference.

  1. I understand that all mpeg-4 are encoded into NAL units and wrt to FFMPEG av_read_frame() function returns one NAL unit, Am I right? Is frame a NAL unit? (though it can be a combination of multiple NALs)

  2. I also saw that h264_parser.c implements a function called h264_parse which is calling parse_nal_units() inside, If i need to get NAL units how can I use this parse_nal_units from my main function?

  3. What is av_parse_Parse2() function do? does it return decoded NAL units?

  4. OR FFMPEG has -vbsf h264_mp4toannexb switch to dump raw NAL units, Can somebody help me understand how I can use the same from my main function?

Please help me out here... -ash5

like image 851
2ndlife Avatar asked May 19 '11 17:05

2ndlife


1 Answers

For question 1: The following article has links that will help you understand what NALs are.

In h264 NAL units means frame.?

NALs are divided into several types, and depending on the type can contain decoding parameters (SPS, PPS), enhancement information (SEI) and video samples (slice header and data). A common sequence from a broadcast transport stream would be SPS, PPS, SEI, slice_header(), slice_data(), SEI, slice_header(), slice_data() *

You probably don't need to understand ISO 14496-10 section 7.3 "Syntax in tabular form" for your application.

like image 196
Mutant Bob Avatar answered Sep 17 '22 11:09

Mutant Bob