Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ssingh179
Beginner
34 Views

Video encoding (H.263, H.264) related clarifications

Hi,

Could somebody from Intel please clarify:

(a) H.263/H.264 encoding: When encoding a frame, is it possible to specify the type of frame (I/P) the encoded frame turns out to be? In other words, is it possible to instruct the encoder thus - encode this raw (YUV) frame, *AND* encode it as an I frame? Please note that this is completely distinct from requesting the encoder to encode every 30th (for example) frame as an I frame.

(b) H.264 encoding: For H.264, every coded frame (access unit) is a sequence of NAL units. Is it possible to constrain the maximum size of a NAL unit that an encoder may create? In other words, is it possible to instruct the encoder thus - encode this raw (YUV) frame, *BUT* under the condition that every NAL unit of the coded frame is less than (for example) 1200 bytes? Of course, the encoder may create as many NAL units as it needs to encode the raw frame, it is just that we wish every NAL unit to be smaller than an application defined maximum size.

Thanks,
S

0 Kudos
3 Replies
shyaki
Beginner
34 Views

Quoting - ssingh179
Hi,

Could somebody from Intel please clarify:

(a) H.263/H.264 encoding: When encoding a frame, is it possible to specify the type of frame (I/P) the encoded frame turns out to be? In other words, is it possible to instruct the encoder thus - encode this raw (YUV) frame, *AND* encode it as an I frame? Please note that this is completely distinct from requesting the encoder to encode every 30th (for example) frame as an I frame.

(b) H.264 encoding: For H.264, every coded frame (access unit) is a sequence of NAL units. Is it possible to constrain the maximum size of a NAL unit that an encoder may create? In other words, is it possible to instruct the encoder thus - encode this raw (YUV) frame, *BUT* under the condition that every NAL unit of the coded frame is less than (for example) 1200 bytes? Of course, the encoder may create as many NAL units as it needs to encode the raw frame, it is just that we wish every NAL unit to be smaller than an application defined maximum size.

Thanks,
S


I am not from Intel, but I can give you some suggestions.

1. If you want to force toinsert I or IDR frames into H264 stream during encoding, you need to modify the sample code to listen to you. Seach

H264CoreEncoder_DetermineFrameType() in the sample code

2. If you want to control the size of NAL, I think you need toplay withmultiple slices per frame and bit-rate control algorithm, but Is it necessary? NAL units usually will be splitted to RTP packets or TS packets anywaybefore transmitting if they are too big.
ssingh179
Beginner
34 Views

Thanks for your inputs.

Regarding (b) (H.264 encoding) - on RTP, if you are interoperating with an endpoint which supports only packetization-mode == 0, you necessarily need to have all NAL units small enough so that each NAL unit can be accommodated in a single RTP packet.
Emmanuel_W_
New Contributor I
34 Views

Quoting - ssingh179
Thanks for your inputs.

Regarding (b) (H.264 encoding) - on RTP, if you are interoperating with an endpoint which supports only packetization-mode == 0, you necessarily need to have all NAL units small enough so that each NAL unit can be accommodated in a single RTP packet.

There is some support in the H.264 encoder for limiting the size of slices. Look for theSLICE_CHECK_LIMIT define.

Emmanuel