typedef struct { int i_ref_idc; /* nal_priority_e */ int i_type; /* nal_unit_type_e */ int b_long_startcode; int i_first_mb; /* If this NAL is a slice, the index of the first MB in the slice. */ int i_last_mb; /* If this NAL is a slice, the index of the last MB in the slice. */ /* Size of payload in bytes. */ int i_payload; /* If param->b_annexb is set, Annex-B bytestream with startcode. * Otherwise, startcode is replaced with a 4-byte size. * This size is the size used in mp4/similar muxing; it is equal to i_payload-4 */ uint8_t *p_payload; } x264_nal_t; p_payload是不带startcode的,需要自己添加,H264要加00 00 00 01
摄像头的采集格式参数设置为:YCbCr_420_SP
{
int i_ref_idc; /* nal_priority_e */
int i_type; /* nal_unit_type_e */
int b_long_startcode;
int i_first_mb; /* If this NAL is a slice, the index of the first MB in the slice. */
int i_last_mb; /* If this NAL is a slice, the index of the last MB in the slice. */ /* Size of payload in bytes. */
int i_payload;
/* If param->b_annexb is set, Annex-B bytestream with startcode.
* Otherwise, startcode is replaced with a 4-byte size.
* This size is the size used in mp4/similar muxing; it is equal to i_payload-4 */
uint8_t *p_payload;
} x264_nal_t;
p_payload是不带startcode的,需要自己添加,H264要加00 00 00 01