Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
51 Views

Problems with insertion of SEI messages (H.264) into the bitstream

Hello,

I try to insert SEI messages (H.264) into the bitstream. I open the output encoded stream with Tektronix MTS4EA Video ES Analyser. But it reports error: End of NAL unit reached while reading RESERVED_SEI_MESSAGE_PAYLOAD_BYTE. I attached screenshot. Below I wrote an example of code as I insert SEI messages. What do I do incorrectly?


mfxSession mfx_session;
mfxIMPL impl = MFX_IMPL_HARDWARE_ANY;
mfxVersion version = {0, 1};
mfxVideoParam mfx_enc_params;
mfxFrameSurface1 pSurface;
mfxSyncPoint EncSyncP;
mfxBitstream mfxBS;

MFXInit(impl, &version, &mfx_session);

// filling of mfx_enc_params structure
mfx_set->mfx.CodecId = MFX_CODEC_AVC;
...

MFXVideoENCODE_Init(mfx_session, &mfx_enc_params);

//initialization of pSurface and mfxBS
...

// SEI message

mfxEncodeCtrl mfxEncCtrl = {0};

unsigned char text[] = "MainConcept";

mfxPayload * p_payload[256];
mfxPayload p;

p.Data = text;
p.BufSize = sizeof(text);
p.NumBit = sizeof(text) * 8;
p.Type = 5; //user_data_unregistered

mfxEncCtrl.Payload = p_payload;
mfxEncCtrl.Payload[0] = &p;
mfxEncCtrl.NumPayload = 1;

MFXVideoENCODE_EncodeFrameAsync(mfx_session, &mfxEncCtrl, pSurface, &mfxBS, &EncSyncP);

//writing encoded data to file...



Thanks,
Marina
0 Kudos
2 Replies
Highlighted
Employee
51 Views

Hi Marina,

Please see the following forum post for how to insert SEI message into H.264 stream.
http://software.intel.com/en-us/forums/showthread.php?t=101849&o=a&s=lr

Hope this helps.
Regards,
Petter
0 Kudos
Highlighted
51 Views

Hi Petter,

Thank you for reply. I corrected my code as in your example. Now SEI messages are inserted without problem.

Best regards,
Marina
0 Kudos